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

Can XML namespaces get into a recursive loop?

  • To: xml-dev@l...
  • Subject: Can XML namespaces get into a recursive loop?
  • From: kar i <karthiki1@y...>
  • Date: Fri, 26 Mar 2004 20:39:46 -0800 (PST)

recursive loop
Hi all,
I am new to this discussion site. I have a question
about using namespaces to 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
finding 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?
Can you tell me how validators handle such an event?
Also please note that there can be no xml instances
that fulfill such schemas !! -- (As they need to be
infinitely recursively deep)
I look forward to your expert comments !!
Thanks
Karthik


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.