You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Michael Rasmussen <ra...@gmail.com> on 2005/03/15 18:10:28 UTC

Nillable and Empty Tags?

I am working on a schema and when I validate against it I get an error
that I don't expect.

The error comes on this line 

		<xsd:element name="disabledDate" type="xsd:dateTime" minOccurs="0"
maxOccurs="1" nillable="true" />

 in this schema. (I left the xmlns declarations for confidentiality)


    <xsd:element name="campusEntities">
        <xsd:complexType>
            <xsd:sequence>                
		<xsd:element ref="campusEntity:campusEntity" minOccurs="1"
maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="campusEntity">
        <xsd:complexType>
            <xsd:sequence>
            	<xsd:element name="campusEntityId"
type="common:uniqueIdentifier" minOccurs="1" maxOccurs="1" />
            	<xsd:element name="storeId" type="common:storeIdentifier"
minOccurs="1" maxOccurs="1" />
            	<xsd:element name="defaultFlag" type="xsd:boolean"
default="false" minOccurs="1" maxOccurs="1" />
		<xsd:element name="disabledFlag" type="xsd:boolean" default="false"
minOccurs="1" maxOccurs="1" />
		<xsd:element name="disabledDate" type="xsd:dateTime" minOccurs="0"
maxOccurs="1" nillable="true" />
            	<xsd:element name="name" type="xsd:string" minOccurs="1"
maxOccurs="1" />
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>


When parsing xml with a <disabledDate/> element in it, I get a "Date
value is of wrong type:" error in my XmlOptions errors.

I am still new to using XmlBeans, so I am not sure, but doesn't
putting nillable="true" on an element allow you to use an empty tag on
it?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org