Hi Joern,

No, this is not possible. The reason for this goes down to how XML is 
parsed - basically, the document is *always* disassembled to its 
component pieces on the way in, so if you want part of the text back as 
XML you have to actively reassemble it.

The best you could do would be to use a DOM Element representation for 
<someElement>. That would allow you to have any kind of XML content for 
the element, and when you wanted the XML as text you'd be able to get it 
by serializing the DOM Element.

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Joern Gebhardt wrote:
> Hi,
>
> I'm trying to map an XML subtree into one single String that contains 
> the uninterpreted XML content of the subtree.
>
> E.g. if I have an XML file like this:
>
> <root>
>   <someElement>
>      <complexStuff>
>        <a attr="true"/>
>        <b>
>          <c>some text</c>
>        </b>
>     </complexStuff>
>   </someElement>
> </root>
>
> and I have a Java object SomeElement like this:
>
> public class SomeElement {
>
>    private String complexStuff;
>
>    // getter and setter for complexStuff
>
> }
>
> When unmarshalling the XML I want the variable "complexStuff" to be 
> set to "<a attr=\"true\"/><b><c>some text<c/></b>"
> And when marshalling the objects I want the content of the 
> "complexStuff" variable written out as it is to become a subtree of 
> the XML document.
>
> The reason for that is that the content of "complexStuff" is an XML 
> segment that shall not be further analyzed.
>
> Is this kind of "partial" mapping possible with JiBX?
>
> Thanks in advance,
> Joern
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to