Hi Priscilla,
Thank you very much for your response, i went through the sample code and
saw how Import was implemented.
I noticed that in those samples the xml schemas belong to same domain
(
http://example.org) like
1)
http://example.org/ord
2)
http://example.org/pord
What I wanted to do is import some elements from XML schema that belongs to
different domain. I have attached my sample xml schema file.
I am pretty new to XML schemas , so forgive me if i am naive.
I refered to your book also, but couldn't see any example where we are
importing from different domains. I don't know whether this can be done or
not. But in my project i have the need to extend from some standard XML
Schemas.
I really appreciate your help.
Regards,
Poonam
************ code snippet******** *************** ******
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="CustomerLis tSchema"
targetNamespace ="http://tempuri.org/details"
attributeFormDe fault="qualifie d"
xmlns="http://tempuri.org/details"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:typLib="h ttp://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:import namespace="http ://www.w3.org/2001/03/XMLSchema/TypeLibrary"
schemaLocation= "http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd " />
<xs:simpleTyp e name="postalCod e">
<xs:restricti on base="xs:positi veInteger">
<xs:pattern value="\d{5}" />
</xs:restriction>
</xs:simpleType>
<xs:complexTy pe name="usAddress ">
<xs:sequence>
<xs:element name="name" type="xs:string " />
<xs:element name="Street" type="xs:string " />
<xs:element name="City" type="xs:string " />
<xs:element name="Zip" type="postalCod e" />
</xs:sequence>
</xs:complexType>
<xs:element name="customerL ist">
<xs:complexType >
<xs:sequence>
<xs:element name="customer" >
<xs:complexType >
<xs:sequence>
<xs:element name="CompanyNa me" type="xs:string " />
<xs:element name="ContactNa me" type="xs:string " />
<xs:element name="Email" type="xs:string " />
<xs:element name="BillToAdd ress" type="usAddress " />
<xs:element name="ShipToAdd ress" type="usAddress " />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="realPart" type="typLib:re alPart" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
*************** *************** *************** *************** *****
"Priscilla Walmsley" <no****@datypic .com> wrote in message
news:eS******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
The examples from my book, Definitive XML Schema, are out at:
http://www.datypic.com/books/DefXMLSchema/Examples.html
The one that has to do with imports and includes is at:
http://www.datypic.com/books/DefXMLS...chapter04.html
That might help. If not, post a snippet of your schemas and maybe we can
tell you what's wrong.
Priscilla
------------------------------------------------------------------
Priscilla Walmsley
Author, Definitive XML Schema / XML in Office 2003
http://www.datypic.com
------------------------------------------------------------------
"Poonam" <po****@none.co m> wrote in message
news:WZ******** **********@nwrd dc02.gnilink.ne t... Hi,
Can some one please help me with (or point me to) a very simple but
working code sample that shows how to import XML Schema.
I have tried many samples out there on internet but nothing seems to be
working. I am trying to import a complex type/simple type element type
from an external xml schema. I am using xs:import tag with namespace and
schemalocation attributes defined and have also declared xmlns relative
to this xml schema. I VS .NET I always get the error that "Type 'xxx' is
not declared."
TIA,
-P!