Greetings,

I have a XML file with N elements child of a root element (list).
I would like to marshalling to a java object instance just the element
child with the key name "XX" instead marshalling all the elements on the
XML file. Can castor do it?

For example, I have a XML file with lots of entries "elements" but only
one of them is required in a certain moment. If my XML file is
considerable big, I will loose several time marshalling objects that I
won't need.

<list>
        <element name="1" />
        <element name="2" />    
        <element name="3" />
        <element name="4" />
        ...
        <element name="N" />
</list>

<!----- SCHEMA ------>

<xs:element name="list" type="listType">
        <xs:key name="element">
            <xs:selector xpath="element"/>
            <xs:field xpath="@name"/>
        </xs:key>
</xs:element>
<xs:element name="element" type="med:elementType"/>
 
<xs:complexType name="listType">
        <xs:sequence>
            <xs:element ref="list" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
</xs:complexType>

<xs:complexType name="elementType">
        <xs:attribute name="name" type="xs:string"/>
</xs:complexType>

thanks,
Pedro Salazar.
-- 
PS
pedro-b-salazar_at_ptinovacao_dot_pt
PGP:0E129E31D803BC61

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

Reply via email to