writing a custom marshaller is fairly easy to learn.

i recommend learning the source code for the
HashMapStringToComplex custom marshaller for
marshalling/unmarshalling hashmaps with string
keys.  it's in jibxextras.  review the code, then write
your own implementation.  also, the javadoc comments
that dennis has placed in his source code are golden.
i definitely recommend scanning through dennis's
source code and the corresponding comments that
explain clearly what a method does, what the parameters
you pass in control, etc..

/ eitan

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

Thanks for this quick answer!
Would it be possible for you to tell me more on how to use these classes? I can see the API doc, but I have no clue on how and when to use them ...
When unmarshaling I know that a given tag contains unpredictable tags (no nested tags, just one level of unpredictable tags). I would like to isolate the content of this tag, that is store the totality of the unpredicted tags as a string so I can process it with DOM later.
Also, when Marshalling, I need some way to get the unpredictable tags and their values (e.g. Hastable containg name & value or the tag) and insert them at a predifined location within the XML message.


I know this is a massive question - and I should be doing my homework :-/ but I am sure you know what IT is at a time human beings have no longer time to have lunch :-)))))

Thanks again.


[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 :-)

  12 football


However, some messages can look like this:

  12 football
 paris 2
2

As you can see, the nested tag '' 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
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.


I've come across this requirement as well, except my "extra info" was
an HTML formatted document. Doing this requires a custom (un)marshaller.


If you look in the jibx/extra source directory there is a
DiscardElementMapper.java and a DomElementMapper.java which should
provide a starting point for you.

This isn't difficult, it just requires a little extra code.


-- Thomas Jones-Low Softstart Services Inc. [EMAIL PROTECTED] JobScheduler for Oracle Ph: 802-398-1012 http://www.softstart.com


-------------------------------------------------------
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


-------------------------------------------------------
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