Re: Can XML namespaces get into a recursive loop?
Joshua Allen <[email protected]> Fri, 26 Mar 2004 10:41:49 -0800
| Newsgroups | gmane.comp.java.sun.xml.general |
|---|---|
| Message-ID | <0E36FD96D96FCA4AA8E8F2D199320E52015A514D@RED-MSG-43.redmond.corp.microsoft.com> |
You need to import the schemas, but circular imports are perfectly acceptable to XSD. The parser included with windows is called MSXML, and it *does* support validation. We had a bug in our managed .NET validator such that in V1.0 and V1.1 we fail on circular imports, but this is fixed in v2.0. If you are using a validation engine that fails on circular imports, it's a bug in the engine. You could probably get more information about which validators support circular imports properly (most do, AFAIK) by asking on xml-dev. Regards, Joshua Allen=20 > -----Original Message----- > From: XML technologies in the Java Platform=20 > [mailto:[email protected]] On Behalf Of Kar I > Sent: Friday, March 26, 2004 12:20 AM > To: [email protected] > Subject: Can XML namespaces get into a recursive loop? >=20 > Hi all, > I am new to this discussion site. I have a question about=20 > using namespaces to define mutually define XML schemas. > Take this example > -----------author.xsd-------------- > <?xml version=3D"1.0"?> > <xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" > xmlns:bc=3D"book1.xsd" > elementFormDefault=3D"qualified"> > <xs:element name=3D"author" type=3D"authorType"/> > <xs:complexType name=3D"authorType"> > <xs:sequence> > <xs:element ref=3D"bc:book"/> > </xs:sequence> > </xs:complexType> > </xs:schema> > -------------------------------------- > ---------book.xsd--------------------- > <?xml version=3D"1.0"?> > <xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" > xmlns:ac=3D"author1.xsd" > elementFormDefault=3D"qualified"> > <xs:element name=3D"book" type=3D"bookType"/> >=20 > <xs:complexType name=3D"bookType"> > <xs:sequence> > <xs:element ref=3D"ac:author"/> > </xs:sequence> > </xs:complexType> >=20 >=20 > </xs:schema> > --------------------------------------- > As you can clearly see that each of these xml schemas use the=20 > other for their definition. I have tried using microsofts=20 > parser(WINXP) and it was only good at find out well=20 > formedness. Then i downloaded Sun Multi-Schema XML Validator,=20 > It performed more predictably, but always pointed the fault=20 > at my xml file, expecting the deeper tag in the recursion. > My question is: Is this a potential flaw in the XSD spec? As=20 > there will always be a possibility that a validator/XML=20 > engine will get into an infinite loop with this? >=20 > I look forward to your expert comments !! >=20 >=20 > Thanks > Karthik >=20 > ----------------------------------------------------- > xml-interest: A list for discussing XML technologies in the=20 > Java Platform. > To post, mailto:[email protected] Archives at:=20 > http://archives.java.sun.com/xml-interest.html > To unsubscribe, mailto:[email protected] the following=20 > message; signoff xml-interest. >=20 ----------------------------------------------------- xml-interest: A list for discussing XML technologies in the Java Platform. To post, mailto:[email protected] Archives at: http://archives.java.sun.com/xml-interest.html To unsubscribe, mailto:[email protected] the following message; signoff xml-interest.