Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - help me on the method of import in the schema [Thread Next] RE: help me on the method of import in the schemaTo: "'XuAnthony'" <xuhaitiancn@---.--->, <xmlschema-dev@--.---> Date: 6/18/2008 4:55:00 PM Because the prefix "lib" refers to the namespace
http://dyomedea.com/ns/library, your references to lib:name and =
lib:person
are references to the element declarations named "name" and "person" in =
the
schema document for target namespace http://dyomedea.com/ns/library. So =
you
have indeed defined them.
I notice that in your instance document
<library xlmns=http://dyomedea.com/ns/library
"xmlns" is misspelled. This could cause a great deal of confusion! In =
fact,
I see your schema even declares an attribute with this name
<xs: attribute name="xlmns" use="required">
presumably because the schema was generated from the instance?
Michael Kay
http://www.saxonica.com/
_____
From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] =
On
Behalf Of XuAnthony
Sent: 18 June 2008 05:27
To: xmlschema-dev@w...
Subject: 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:
=CF=C2=C3=E6=B5=C4=D2=C9=CE=CA=C0=EF=C3=E6=A3=BAdoublenamespacefix1.xsd =
=CE=C4=BC=FE=D6=D0=D3=D0
<xs: element ref="lib: name"/> =BA=CD <xs:element ref="lib: =
person"/> =B5=AB=CE=D2=D4=DA=D5=E2=B8=F6
=CE=C4=B5=B5=C0=EF=C3=E6=C3=BB=D3=D0=B6=A8=D2=E5=B9=FD lib: name =BA=CD =
lib: person, =D6=BB=B6=A8=D2=E5=B9=FD <xs: element
name="name" type="xs: string"/> =BA=CD <xs: element =
name="person">=A3=AC=C4=C7=C3=B4=A3=AClib:
name=BA=CDlib: person =D6=B8=CA=B2=C3=B4=C4=D8=A3=BF
3.xml=CE=C4=B5=B5=D6=D0
<book id="b0836217462" xmlns: lib="http://dyomedea.com/ns/library"> =
=A1=A3=A1=A3=A1=A3
</book> =D2=FD=D3=C3=B5=C4lib,=B8=C3lib =
=C3=FC=C3=FB=BF=D5=BC=E4=CA=C7=B4=E6=D4=DA=D3=DA=A3=A8=BB=F2=D3=C9=A3=A9d=
oublenamespacefix.xsd =B6=A8=D2=E5
=C4=D8=A3=BF=BB=B9=CA=C7 =D3=C9 doublenamespacefix1.xsd =
=C0=B4=B6=A8=D2=E5=C4=D8=A3=BF
4.<lib: authors>=A1=A3=A1=A3=A1=A3</lib: =
authors>=CE=D2=D6=AA=B5=C0=D3=C9=C3=FB=B3=C6=CE=AAlib=B5=C4=C3=FC=C3=FB=BF=
=D5=BC=E4=CF=DE=B6=A8=A3=AC=B5=AB=BE=BF=BE=B9
=CA=C7 doublenamespacefix.xsd =B6=A8=D2=E5=C4=D8=A3=BF=BB=B9=CA=C7 =
=D3=C9 doublenamespacefix1.xsd =C0=B4=B6=A8=D2=E5=C4=D8=A3=BF
=C1=BD=B8=F6=B6=BC=D3=D0<xs: schema xmlns: =
lib="http://dyomedea.com/ns/library" =A1=A3=A1=A3=A1=A3=A1=A3
5. =CE=AA=C9=B6doublenamespacefix1.xsd =D3=D0 =
targetnamespace,=B6=F8doublenamespacefix.xsd
=C3=BB=D3=D0=C4=D8=A3=BF
6. =CE=AA=CA=B2=C3=B4xml=CE=C4=B5=B5=C0=EF=C3=E6=D2=AA=BC=D3 =
noNamespaceSchemaLocation=A3=BF=D7=F6=C9=B6=D3=C3=A3=BF
=D0=BB=D0=BB=A1=A3
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">
=A1=A3=A1=A3=A1=A3</book> ,the lib is defined by doublenamespacefix.xsd =
or
doublenamespacefix1.xsd ?
3. the .<lib: authors>=A1=A3=A1=A3=A1=A3</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:\=D1=A7=B5=E7=C4=D4\=B8=F6=C8=CB=CD=F8=D5=BE=
=C9=E8=BC=C6
\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:\=D1=A7=B5=E7=C4=D4\=B8=F6=C8=CB=CD=F8=D5=BE=C9=E8=BC=C6
\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>
_____
Windows Live =
Writer=A3=AC=D6=A7=B3=D6=C0=EB=CF=DF=D7=AB=D0=B4=B2=A9=BF=CD=C4=DA=C8=DD=A3=
=AC=CB=E6=CA=B1=CB=E6=B5=D8=CF=EB=D0=B4=BE=CD=D0=B4=A1=A3 =
=C1=A2=BC=B4=CA=B9=D3=C3=A3=A1
<http://get.live.cn/product/writer.html>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
