none
schemalocation,import哪位高手能,要求既解释xml,也解释对应的xsd的语法,尤其是命名空间部分和import 部分,越详细越好 RRS feed

  • 问题

  •  

    doublenamespacefix.xml
    XML code
    <?xml version="1.0"?> <!-- Namespace: http://dyomedea.com/ns/library --> <library xlmns="http://dyomedea.com/ns/library" xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation="k:\学电脑\个人网站设计\XMLTRY~1\doublenamespaceFix.xsd"> <!-- <library xmlns:l="http://dyomedea.com/ns/library" xlmns="http://dyomedea.com/ns/library" xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation="http://dyomedea.com/ns/library I:\学电脑\个人网站设计\XMLTRY~1\doublenamespace.xsd"> --> <book id="b0836217462" xmlns: lib="http://dyomedea.com/ns/library"> <title> Being a Dog Is a Full-Time Job </title> <lib: authors> <person id="CMS" xmlns="http://dyomedea.com/ns/library"> <name> Charles M Schulz </name> </person> </lib: authors> </book> </library>


    doublenamespacefix.xsd
    XML code
    <?xml version="1.0" encoding="UTF-8"?> <xs: schema xmlns: lib="http://dyomedea.com/ns/library" xmlns: xs="http://www.w3.org/2001/XMLSchema"> <xs: import namespace="http://dyomedea.com/ns/library" schemaLocation="doublenamespaceFix1.xsd"/> <xs: element name="title" type="xs: string"/> <xs: element name="library"> <xs: complexType> <xs: sequence> <xs: element ref="book"/> </xs: sequence> <xs: attribute name="xlmns" use="required"> <xs: simpleType> <xs: restriction base="xs: anyURI"> <xs: enumeration value="http://dyomedea.com/ns/library"/> </xs: restriction> </xs: simpleType> </xs: attribute> </xs: complexType> </xs: element> <xs: element name="book"> <xs: complexType> <xs: sequence> <xs: element ref="title"/> <xs: element ref="lib: authors"/> </xs: sequence> <xs: attribute name="id" use="required"> <xs: simpleType> <xs: restriction base="xs: string"> <xs: enumeration value="b0836217462"/> </xs: restriction> </xs: simpleType> </xs: attribute> </xs: complexType> </xs: element> </xs: schema>


    doublenamespacefix1.xsd
    XML code
    <?xml version="1.0" encoding="UTF-8"?> <xs: schema xmlns:lib="http://dyomedea.com/ns/library" xmlns: xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dyomedea.com/ns/library"> <xs: element name="person"> <xs: complexType> <xs: sequence> <xs:e lement ref="lib: name"/> </xs: sequence> <xs: attribute name="id" use="required"> <xs: simpleType> <xs: restriction base="xs: string"> <xs: enumeration value="CMS"/> </xs: restriction> </xs: simpleType> </xs: attribute> </xs: complexType> </xs: element> <xs: element name="name" type="xs: string"/> <xs: element name="authors"> <xs: complexType> <xs: sequence> <xs: element ref="lib: person"/> </xs: sequence> </xs: complexType> </xs: element> </xs: schema>
    谁能给我个详细介绍import使用带好些例子说明的文章啊,谢谢。
    
    2008年6月17日 12:59

全部回复