hi cedric,

  have you looked at the dom4jelementmapper custom marshaller?
  i personally really like it (that's also because i personally really
  like dom4j a lot).  anyway, you should be able to specify in your
  mapping that a specific part of your xml should be handled
  by it.  when you unmarshal what you get back is a dom4j element.
  you can parse using xpath and more.  it's wonderful.  the other
  way around should work just as well.  pass it a dom4j element to
  be included in an xml document to be serialized, et puis voila.

/ eitan

On Apr 11, 2005, at 4:28 AM, [EMAIL PROTECTED] wrote:

Hello,

I have the following problem:
I have to deal with XML messages that are pretty much complient.
However some messages contain a "dynamic" part - Let me explain.

The following message is standard and well defined by a XSD - so I have my JiBX mapping that works just well :-)

<message>
<user name="cedric">
    <age>12</age>
    <sport>football</sport>
    <extrainfo>
    </extrainfo>
</user>
</message>

However, some messages can look like this:

<message>
<user name="cedric">
    <age>12</age>
    <sport>football</sport>
    <extrainfo>
        <CITY>paris</CITY>
        <NBRBROTHERS>2</NBRBROTHERS>
        <NBRSISTERS>2</NBRSISTERS>
    </extrainfo>
</user>
</message>

As you can see, the nested tag '<extrainfo>' may contain any unpredicted tag, in this example "CITY", "NBRBROTHERS" and "NBRSISTERS" are not defined in the XSD and can be anything really - depending on customer's requirements.

I would like to be able to get anything within the tag <extrainfo> and put it as is (the fragment of XML message) into a String object of my mapped bean - later I would use standard DOM to analyse this dynamic part in my code - independently from JiBX.

Now is it possible to put the content of a tag (all its nested tags) into a simple String object in JiBX? If not it really is a pain as I would not be able to use JiBX unless someone has a workaround (?)

May thanks for your support in this great software that JiBX is.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to