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

RE: UPA violation or not?

From: <paul.downey@bt.com>
Date: Thu, 16 Dec 2004 14:47:51 -0000
Message-ID: <2B7789AAED12954AAD214AEAC13ACCEF2709DE5B@i2km02-ukbr.domain1.systemhost.net>
To: <mike@saxonica.com>, <xmlschema-dev@w3.org>
paul downey

fwiw my version of Apache xmlbeans validate.cmd rejects this 
schema as containing a UPA violation, whereas my .NET 1.1 
xsd.exe command generates a nice little C# class without 
batting an eyelid:

public class bar {

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("pongo")]
    public string[] pongo;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("pongo")]
    public string[] pongo1;
}


Paul


-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Michael Kay
Sent: 16 December 2004 00:19
To: xmlschema-dev@w3.org
Subject: UPA violation or not?



Xerces reports this schema as a UPA violation, XSV reckons it is OK. Which
is correct?

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:complexType name="bar">
		<xs:sequence>
		  <xs:element ref="pongo" minOccurs="0" maxOccurs="2"/>
		  <xs:element ref="pongo" minOccurs="0" maxOccurs="2"/>
		</xs:sequence>
  	</xs:complexType>
	<xs:element name="doc" type="bar"/>
	<xs:element name="pongo" type="xs:string"/>
</xs:schema>

Saxon 8.1 reports it as ambiguous, my current build of Saxon 8.2 doesn't (an
unintentional side-effect of an unrelated change). 

My reading of the spec is that it probably is ambiguous, but that it really
doesn't need to be.

Michael Kay
Received on Thursday, 16 December 2004 14:47:31 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.