Hello,


I have a problem in marshalling elements that have to be unqualified. Here is the smallest example.


The schema contains only a root element and a single child:

Schema.xsd
----------
<xs:schema targetNamespace="testns" xmlns="testns" xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault=
"unqualified" attributeFormDefault="unqualified">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="Child">
<xs:complexType/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
----------


When I marshal a sample document with

        Root root = new Root();
        root.setChild(new Child());
        root.marshal(new java.io.FileWriter("castor_marshal.xml"));

I get the following:

        <?xml version="1.0" encoding="UTF-8"?>
        <Root xmlns="testns"><Child/></Root>

This does not comply with the schema (since the element "Child" must go unqualified according to Schema.xsd).

Am I doing anything wrong or is this a bug?

Thanks,
        Hans

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to