That's a lot more difficult than you might expect (using JiBX, or any other form of XML processing I'm aware of). The problem is that JiBX is using a parser for reading the data from the document, and parsers don't allow you to just suddenly start reading raw text (tags and all). It would be possible to do this with a custom unmarshaller that would basically take the parsed XML and turn it back into a text string, but even once this was done you'd have no way to include this directly in a marshalled output.

A better solution may be to use the DOM or dom4j marshaller/unmarshaller support in beta 3a. These let you convert the <y> element to a tree of component objects you can access using the standard DOM or dom4j APIs. If you want to just get the XML text as a String, I think the dom4j asXML() method will return it. Doing it this way also means it'll marshal back out properly, if that's a concern.

- Dennis

Robert Augustyn wrote:

Hi,
I have finally get going with this stuff and it looks
good but I have
run into another challenge and I am not quite sure how
to solve it,
anything I tried did not seem to work, but I think
should be possible :)

How do you bind scenario when <y> element contains
another xml document
of unknown format which we want to bind to a single
String field in an
object?
Thanks for taking the time.
robert

<y>
        <x>
                <a>
                </a>
                ....    
        </x>
</y>

Or:

<y>
        <x1>
                <a1>
                </a1>
                ....    
        </x1>
</y>






------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to