[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

help me on the method of import in the schema

From: XuAnthony <xuhaitiancn@msn.com>
Date: Wed, 18 Jun 2008 04:27:26 +0000
Message-ID: <BAY130-W2866A2C7624A9BBC035F69B7AB0@phx.gbl>
To: <xmlschema-dev@w3.org>
help me on the method of import in the schema

Dear sir:
i wonder the following examples of the import method  in the schema?
following is the chinese character question:
 
ÏÂÃæµÄÒÉÎÊÀïÃæ£ºdoublenamespacefix1.xsd ÎļþÖÐÓÐ 
<xs: element ref="lib: name"/> ºÍ <xs:element ref="lib: person"/> µ«ÎÒÔÚÕâ¸öÎĵµÀïÃæÃ»Óж¨Òå¹ý lib: name ºÍ lib: person, Ö»¶¨Òå¹ý <xs: element name="name" type="xs: string"/> ºÍ <xs: element name="person">£¬ÄÇô£¬lib:  nameºÍlib:  person Ö¸Ê²Ã´ÄØ£¿
3.xmlÎĵµÖÐ
 <book id="b0836217462" xmlns: lib="http://dyomedea.com/ns/library"> ¡£¡£¡£</book> ÒýÓõÄlib,¸Ãlib ÃüÃû¿Õ¼äÊÇ´æÔÚÓÚ£¨»òÓÉ£©doublenamespacefix.xsd ¶¨ÒåÄØ£¿»¹ÊÇ ÓÉ doublenamespacefix1.xsd À´¶¨ÒåÄØ£¿
4.<lib: authors>¡£¡£¡£</lib: authors>ÎÒÖªµÀÓÉÃû³ÆÎªlibµÄÃüÃû¿Õ¼äÏÞ¶¨£¬µ«¾¿¾¹ÊÇ doublenamespacefix.xsd ¶¨ÒåÄØ£¿»¹ÊÇ ÓÉ doublenamespacefix1.xsd À´¶¨ÒåÄØ£¿Á½¸ö¶¼ÓÐ<xs: schema xmlns: lib="http://dyomedea.com/ns/library" ¡£¡£¡£¡£
5. Ϊɶdoublenamespacefix1.xsd ÓÐ targetnamespace,¶ødoublenamespacefix.xsd ûÓÐÄØ£¿
6. ΪʲôxmlÎĵµÀïÃæÒª¼Ó noNamespaceSchemaLocation£¿×öɶÓã¿
лл¡£
 
1. in the following example, those <xs: element ref="lib: name"/> and <xs:element ref="lib: person"/> indicate that i should hvae defined a lib:name and lib:person, but i never defined a thing like that in the following whole codes?
so , what is the lib:name and lib:person?
2. in the following codes
   <book id="b0836217462" xmlns: lib="http://dyomedea.com/ns/library"> ¡£¡£¡£</book> ,the lib is defined by doublenamespacefix.xsd  or doublenamespacefix1.xsd ?
3. the .<lib: authors>¡£¡£¡£</lib: authors>, authors is defined in the doublenamespacefix.xsd  or doublenamespacefix1.xsd ?
4. why there is  targetnamespace in the doublenamespacefix1.xsd,but there is not any targetnamespace doublenamespacefix.xsd?
5  why the xml instance in the following whole codes has the noNamesapceSchemaLocation? what is the usage and meaning of the noNamespaceSchemalocation?
 
could you give the some detail examples and explainations of those detail examples? thank you very much .
 
the next is the full example:(whole codes)
 
 
 
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>
 
_________________________________________________________________
ÓÃÊÖ»úMSNÁÄÌìдÓʼþ¿´¿Õ¼ä£¬ÎÞÏÞ¹µÍ¨£¬·ÖÏí¾«²Ê£¡
http://mobile.msn.com.cn/
Received on Wednesday, 18 June 2008 14:19:34 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.