Hi all,

At my first try with castor i've got a strange result when i unmarshal and marshal my xml file.
In my original xml file 'itemvalue' is a property.
<selecties>
<itemoms>VO</itemoms>
<itemvalue>false</itemvalue>
</selecties>
After marshal this xml, 'itemvalue' has become an attribute.
<selecties itemvalue="false" valid="true">
<itemoms>VO</itemoms>
</selecties>


This is not what i want. Is there something wrong with my schema ? (I didn't see it).
Can somebody help me ?


Thanks in advance.

Peter

MORE DETAILS
-------------
Here my schema file :
------------------------------------------------------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

   <xsd:annotation>
      <xsd:documentation xml:lang="du">
      Evaluatie test XMLschema
      </xsd:documentation>
   </xsd:annotation>

<!-- definition of simple types -->
    <xsd:simpleType name="omsType">
      <xsd:restriction base="xsd:string">
         <xsd:maxLength value="32"/>
      </xsd:restriction>
   </xsd:simpleType>

<!-- definition of complex types -->
   <xsd:complexType name="itemsType">
      <xsd:sequence>
         <xsd:element name="itemoms" type="xsd:string"/>
         <xsd:element name="itemvalue" type="xsd:boolean"/>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="selectieType">
      <xsd:sequence>
         <xsd:element name="selectieoms" type="omsType"/>
         <xsd:element name="selecties" type="itemsType" minOccurs="1"
             maxOccurs="unbounded"/>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="groepType">
      <xsd:sequence>
         <xsd:element name="groeplabel" type="xsd:string" minOccurs="0"
             maxOccurs="unbounded"/>
         <xsd:element name="groep" type="selectieType" minOccurs="1"
             maxOccurs="unbounded"/>
         <xsd:element name="motivatielabel" type="xsd:string" minOccurs="1"
             maxOccurs="unbounded"/>
         <xsd:element name="motivatie" type="xsd:string" minOccurs="1"
             maxOccurs="unbounded"/>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="containerType">
      <xsd:sequence>
         <xsd:element name="container" type="groepType" minOccurs="1"
             maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="punten" type="xsd:nonNegativeInteger"/>
   </xsd:complexType>

<xsd:element name="evaluatie" type="containerType" minOccurs="1"/>

</xsd:schema>
------------------------------------------------------------
My start xml file to unmarshal
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<evaluatie punten="0">
   <container>
      <groeplabel>Dit mag/kan weg</groeplabel>
      <groep>
         <selectieoms>Voorbereiding</selectieoms>
         <selecties>
            <itemoms>VO</itemoms>
            <itemvalue>false</itemvalue>
         </selecties>
       </groep>
      <groeplabel>Algemeen</groeplabel>
    </container>
</evaluatie>
------------------------------------------------------------
My result xml file after marshal
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<evaluatie punten="18">
    <container valid="true" groep-count="1" motivatielabel-count="0"
        groeplabel-count="2" motivatie-count="0">
        <groep selecties-count="1" valid="true">
            <selecties itemwaarde="false" valid="true">
                <itemoms>VO</itemoms>
            </selecties>
            <selectieoms>Voorbereiding</selectieoms>
        </groep>
        <groeplabel>Dit mag/kan weg</groeplabel>
        <groeplabel>Algemeen</groeplabel>
    </container>
</evaluatie>

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




Reply via email to