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

Recursive XSD with targetNamespace

From: Todd Moon <tmrfcm@gmail.com>
Date: Fri, 14 Nov 2008 15:23:43 -0500
Message-ID: <2dc6e4c80811141223j72b42771qdf9e6a21c747570a@mail.gmail.com>
To: xmlschema-dev@w3.org
Recursive XSD with targetNamespace
Hello everyone.

I have a recursively defined type called "Item" and the schema works fine at
first. However, if I specify a targetNamespace in the XSD, Visual Studio
gives me an error claiming that "Item" is not defined (when it's used within
the definition of Item itself.)

Here's a greatly simplified schema that still exposes the problem:

<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema
   targetNamespace="http://foo"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <xsd:complexType name="Item">
       <xsd:sequence>
           <xsd:element name="SerialNumber" />
           <xsd:sequence>
               <xsd:element name="Item" type="Item" />
           </xsd:sequence>
       </xsd:sequence>
   </xsd:complexType>

</xsd:schema>

If I remove the targetNamespace attribute this works fine. Why is this
causing a problem?

Thanks!

- Todd Moon
Received on Friday, 14 November 2008 20:24:26 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.