Hi everybody.

I need a suggestion please how to properly unmarshal mixed content and xsd:any's. E.g. in a declaration as the following:

<xsd:complexType name="someType" mixed="true">
  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
    <xsd:any processContents="skip" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="type" use="required" />
</xsd:complexType>

I can have <someElem>text here<tag>something here</tag>text here</someElem>.

Now when generating java via the xml code generator, I end up with a class SomeType and one SomeTypeItem. The latter holds the tags, the former holds the text content via the _content field (#setContent(), #getContent()).

What I'll end up with when unmarshalling and marshalling again above example would be: <someElem>text heretext here<tag>something here</tag></someElem>. Notice how the "<tag>" has moved. Or to give another example: <someElem>C<sub>6</sub>H<sub>12</sub>O<sub>6</sub></someElem> (i.e. glucose) turns into <someElem>CHO<sub>6</sub><sub>12</sub><sub>6</sub></someElem> (i.e. .. uh?).

I don't see any place where enough information is stored to restore the mixed content truly. Maybe I'm overseeing something here. So: How to properly unmarshal and marshal again above examples (via code generated by the castor code generator)?

Thanks in advance,

-Martin

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to