You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Kazmi, Azfar" <ak...@idanalytics.com> on 2007/10/19 23:48:02 UTC

underlying xml

I hope I can avoid digging through the source by asking here:

 

Does XmlObject maintain an underlying xml when only setters/getters are
being used? For example, is marshalling/un-marshalling occurring in the
following:

 

XyzTypeDocument doc = XyzTypeDocument.Factory.newInstance();

XyzType xyzType = doc.addNewXyzType();

int something = xyz.getSomething();

xyz.setSomething (something);

 

Or marshalling only occurs at parse() and un-marshalling on toXml()?

 

Azfar

 


Re: underlying xml

Posted by Jacob Danner <ja...@gmail.com>.
Hi Azfar,
XmlObject maintains the xml as its manipulated.

In your code above, basically what your instance would look like is:

XyzTypeDocument doc = XyzTypeDocument.Factory.newInstance();

<xyz />

XyzType xyzType = doc.addNewXyzType();

<xyz><xyzType /></xyz>

xyz.setSomething ("something");

<xyz something="something"><xyzType /></xyz>

String something = xyz.getSomething();
I changed the order to better demonstrate what is occuring.

Hope this helps,
-jacobd

On 10/19/07, Kazmi, Azfar <ak...@idanalytics.com> wrote:
>
>  I hope I can avoid digging through the source by asking here:
>
>
>
> Does XmlObject maintain an underlying xml when only setters/getters are
> being used? For example, is marshalling/un-marshalling occurring in the
> following:
>
>
>
> XyzTypeDocument doc = XyzTypeDocument.Factory.newInstance();
>
> XyzType xyzType = doc.addNewXyzType();
>
> int something = xyz.getSomething();
>
> xyz.setSomething (something);
>
>
>
> Or marshalling only occurs at parse() and un-marshalling on toXml()?
>
>
>
> Azfar
>
>
>