Title: RE: nillable element with default values

So, nobody with a good answer for me?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 19, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: nillable element with default values

I am wondering if this is a Xerces bug or something that I missed in the XML
Schema specification.
Using the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://my.company.com"
            xmlns="http://my.company.com"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="root">
        <xsd:complexType>
            <xsd:sequence>
            <xsd:element name="elem1" default="elem1 default"
nillable="true">
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base="xsd:string"/>
                        </xsd:simpleContent>
                    </xsd:complexType>   
                </xsd:element>
        </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

And the following document:

<?xml version="1.0" encoding="UTF-8"?>
<ns:root xmlns:ns="http://my.company.com"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://my.company.com nillable.xsd">
  <elem1 xsi:nil="true"/>
</ns:root>

I get an error message from Xerces when parsing the document: "Message:
Element elem1 with attribute xsi:nil=true must be empty"
I check the XML Schema specification. It is explicitly said that if nillable
is true you can not have a fixed value, but I did not find anything related
to default values which is what I have in my case (elem1 as a default value
declared in the schema). Any ideas?

Thanks in advance for any help.

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to