You need to use Document object to transform xml and not part of them
If your xobj is not one xptoDocument where xpto is your element root
name, the xml genereted will have fragment name in root element.
Att
Gustavo de Aquino
On Nov 9, 2007, at 7:42 AM, imorales <[EMAIL PROTECTED]> wrote:
Hi. I have a problem parsing a xml.
Why xmlbeans replace root document element adding <xml-fragment>.
XML to parse:
---------------------------------
<person>
<name>A name</name>
<surname>A surname</surname>
</person>
---------------------------------
I parse the document:
XmlOptions options = new XmlOptions();
options.setLoadReplaceDocumentElement(null);
xobj = Person.Factory.parse(xml, options);
And when print the result :
xobj.xmlText(options);
---------------------------------
<xml-fragment>
<name>A name</name>
<surname>A surname</surname>
</xml-fragment>
---------------------------------
I think the parse don“'t know what its the root of the document and
ignores
the root of the xml in and changes it by <xml-fragment>. How can I
do to set
the root element ?
So many thanks in advance.
--
View this message in context:
http://www.nabble.com/%3Cxml-fragment%3E-tf4776678.html#a13663978
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]