Can XML namespaces get into a recursive loop?
Kar I <[email protected]> Fri, 26 Mar 2004 01:20:23 -0700
| Newsgroups | gmane.comp.java.sun.xml.general |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hi all,
I am new to this discussion site. I have a question
about using namespaces to define mutually define XML
schemas.
Take this example
-----------author.xsd--------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bc="book1.xsd"
elementFormDefault="qualified">
<xs:element name="author" type="authorType"/>
<xs:complexType name="authorType">
<xs:sequence>
<xs:element ref="bc:book"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
--------------------------------------
---------book.xsd---------------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ac="author1.xsd"
elementFormDefault="qualified">
<xs:element name="book" type="bookType"/>
<xs:complexType name="bookType">
<xs:sequence>
<xs:element ref="ac:author"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
---------------------------------------
As you can clearly see that each of these xml schemas
use the other for their definition. I have tried using
microsofts parser(WINXP) and it was only good at find
out well formedness. Then i downloaded Sun
Multi-Schema XML Validator, It performed more
predictably, but always pointed the fault at my xml
file, expecting the deeper tag in the recursion.
My question is: Is this a potential flaw in the XSD
spec? As there will always be a possibility that a
validator/XML engine will get into an infinite loop
with this?
I look forward to your expert comments !!
Thanks
Karthik
-----------------------------------------------------
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.