Hi,

On Friday, January 10, 2003, at 06:40  AM, Christophe CAENEVET wrote:
I am trying to map an element inside a choice which is inside a sequence.
I don't know how to make the mapping file.

Here is my XSD.
<xs:element name="document">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element ref="noteinfo" minOccurs="0"/>
</xs:choice>
<xs:choice>
<xs:element ref="item" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:element>
First, a schema tip: I don't think that you are using choice correctly. The idea of choice is that it designates a slot in the XML doc where exactly one of a set of options will go. Here, you've got only one option in each of your choices, so using the choice structure is redundant.

On this Schema, the source generator creates a class Document which content
a DocumentChoice (which contain noteinfo) and a Documentchoice2 (which
contains items)

In my XML I have the document :

<document xmlns="http://www.lotus.com/dxl"; version="1.01" form="Test">
<noteinfo>
...
</noteinfo>
<item name="Test1">
<text>Sample text</text>
</item>
</document>

So how do I tell in the mapping file to store the <item> inside the choice2
?
If you are using source generator, you don't need a mapping file to do XML [un]marshalling. Just make sure to compile the *Descriptor classes that source generator creates alongside the object model.

HTH,
Rhett
--
Rhett Sutphin
Research Assistant (Software)
Coordinated Laboratory for Computational Genomics
and the Center for Macular Degeneration
University of Iowa - Iowa City, IA 52242 - USA
4111 MEBRF - email: [EMAIL PROTECTED]

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



Reply via email to