=?ISO-8859-1?Q?Re=3A=20=27Re=3A=20=5Bxml=5D=20=22w3c=20xml=20schema=3A=20test=20schema=20po1=5F0=2Exsd=20might=20be=20invalid=22=27?=



Hi,

on 5/7/2004 8:17 PM Daniel Veillard wrote:
On Fri, May 07, 2004 at 06:10:55PM +0200, Kasimier Buchcik wrote:

Is this xsd schema invalid? Any comments?


  It seems that at this spoint you have a better understanding of the
XSD spec than I do. Various approaches are possibles:
  - ask on the schemas list at W3C
  - try with other validators like xerces, MS or XSV
  - try to find examples in the existing XSD test suites covering this.

  Until we have a formal definition of the XSD structure spec, trying
to decypher it to get a definitive answer seems a bit doomed, at least
the other approaches may lead to interoperability with other schemas tools.

Surprisingly I stumbled over an example schema of the XML Schema primer 
(http://www.w3.org/TR/xmlschema-0/) with the name po1.xsd (!).
Here it is:

<schema xmlns="http://www.w3.org/2001/XMLSchema";
         xmlns:po="http://www.example.com/PO1";
         targetNamespace="http://www.example.com/PO1";
         elementFormDefault="unqualified"
         attributeFormDefault="unqualified">

  <element name="purchaseOrder" type="po:PurchaseOrderType"/>
  <element name="comment"       type="string"/>

  <complexType name="PurchaseOrderType">
   <sequence>
    <element name="shipTo"    type="po:USAddress"/>
    <element name="billTo"    type="po:USAddress"/>
    <element ref="po:comment" minOccurs="0"/>
    <!-- etc. -->
   </sequence>
   <!-- etc. -->
  </complexType>

  <complexType name="USAddress">
   <sequence>
    <element name="name"   type="string"/>
    <element name="street" type="string"/>
    <!-- etc. -->
   </sequence>
  </complexType>

  <!-- etc. -->

</schema>

The test file under /test/schemas seems to be just an extended version 
of this reference example. Hm, I wonder where it came from. I guess the 
unprefix reference to the "comment" element declaration is just a typo, 
since references to complex type definitions are properly prefixed in 
the test file.

So I hope this is enough evidence for the error in the po1.xsd test file.

Greetings,

Kasimier




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]