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

Re: A bug or incorrect logic?

From: Michael Glavassevich <mrglavas@ca.ibm.com>
Date: Fri, 31 Oct 2008 13:46:56 -0400
To: Arshad Noor <arshad.noor@strongauth.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFCB232C3B.064275A6-ON852574F3.00612C29-852574F3.0061AE8B@ca.ibm.com>
Re: A bug or incorrect logic?

Xerces is telling you that the content is incomplete and gives you a list
of all the choices for what can go next in the sequence. The first element
child of <SignerName/> must be one of {PersonPrefixName, PersonFirstName,
PersonGivenName}. What follows next depends on which one you chose.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

xmlschema-dev-request@w3.org wrote on 10/31/2008 01:22:55 PM:

>
> I have a complex-type defined as follows:
>
> <xsd:complexType name="PersonNameType">
>    <xsd:sequence>
>              <xsd:element name="PersonPrefixName"
> type="PersonPrefixNameType" minOccurs="0" maxOccurs="1"/>
>              <xsd:choice>
>                  <xsd:element name="PersonFirstName"
> type="PersonGivenNameType" minOccurs="1" maxOccurs="1"/>
>                  <xsd:element name="PersonGivenName"
> type="PersonGivenNameType" minOccurs="1" maxOccurs="1"/>
>              </xsd:choice>
>              <xsd:element name="PersonMiddleName"
> type="PersonMiddleNameType" minOccurs="0" maxOccurs="1"/>
>              <xsd:choice>
>                  <xsd:element name="PersonLastName"
> type="PersonSurNameType" minOccurs="1" maxOccurs="1"/>
>                  <xsd:element name="PersonSurName"
> type="PersonSurNameType" minOccurs="1" maxOccurs="1"/>
>              </xsd:choice>
>              <xsd:element name="PersonSuffixName"
> type="PersonSuffixNameType" minOccurs="0" maxOccurs="1"/>
>              <xsd:element name="PersonMaidenName"
> type="PersonMaidenNameType" minOccurs="0" maxOccurs="1"/>
>              <xsd:element name="PersonFullName"
> type="PersonFullNameType" minOccurs="0" maxOccurs="1"/>
>          </xsd:sequence>
> </xsd:complexType>
>
> When testing with an instance where the SignerName element
> is of type PersonNameType, and is deliberately kept empty
> (as follows):
>
>   <SignerName/>
>
> the XML Schema tool gives me the following error:
>
> cvc-complex-type.2.4.b: The content of element 'SignerName' is not
> complete. One of '{PersonPrefixName, PersonFirstName, PersonGivenName}'
> is expected. [129]
>
> However, the PersonPrefixName has a minOccurs of "0", so
> why am I seeing an error where the tool insists that the
> PersonPrefixName is expected?
>
> Thanks.
>
> Arshad Noor
> StrongAuth, Inc.
Received on Friday, 31 October 2008 17:47:37 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.