how
are you saving the your object?
Normally when you create your actual object you first create a document
factory object that
you
use to create you actual document (VinDecodeRequest).
If you
save just the actual document it will generate the xml as a
fragment
because the actual document is considered a part of the document factory
object.
So to
generate a proper xml document you need to save the doucment
factory object. So maybe if you save it the proper way you will be able
to input it later on.
Sorry
if my terminology is off. I am new to xmlbeans myself.
[Bartlett, David
HLTH:EX]
-----Original Message-----
From: Paul Grillo [mailto:[EMAIL PROTECTED]
Sent: Friday, February 03, 2006 7:52 AM
To: [email protected]
Subject: XmlObject.parse xmlFragment workaround?I have been having problems parsing incoming xml for my XMLBeans object. The classes were generated from XSD Schemas.XMLObjec Class Name: VinDecodeRequestIf I populate it and issue oVinDecodeRequest.save(...) it produces the following xml. It places <xml-fragment> where normally integrated with our SOA system the xml-fragment tag is replaced with the the pair of tags:<VinDecodeRequest xmlns="http://vindecode.servicebeans.trivin.com"> </VinDecodeRequest>The input xml below parses:<?xml version="1.0" encoding="UTF-8"?>
<xml-fragment>
<vin:ProductID xmlns:vin="http://vindecode.servicebeans.trivin.com">100</vin:ProductID>
<vin:Fields xmlns:vin="http://vindecode.servicebeans.trivin.com">
<com:Field xmlns:com="http://common.servicebeans.trivin.com">
<com:Name>VIN</com:Name>
<com:Value>4F4YR12U63TM07491</com:Value>
</com:Field>
</vin:Fields>
</xml-fragment>The input xml does not parse:<?xml version="1.0" encoding="UTF-8"?>
<VinDecodeRequest xmlns="http://vindecode.servicebeans.trivin.com">
<vin:ProductID xmlns:vin="http://vindecode.servicebeans.trivin.com">100</vin:ProductID>
<vin:Fields xmlns:vin="http://vindecode.servicebeans.trivin.com">
<com:Field xmlns:com="http://common.servicebeans.trivin.com">
<com:Name>VIN</com:Name>
<com:Value>4F4YR12U63TM07491</com:Value>
</com:Field>
</vin:Fields>
</VinDecodeRequest>The ONLY way i seem to be able to read in XML and create the appropriate VinDecodeRequest object is if the XML i'm reading in actually "contains" <xml-fragment> tags. How can i XmlObject.parse to properly parse the incoming XMLThe code i use is fairly straight forward, i set the schematype to the appropriate classXmlOptions opts = new XmlOptions();SchemaType type = XmlBeans.typeForClass(com.trivin.servicebeans.vindecode.VinDecodeRequest.class);opts.setDocumentType(type);XmlObject obj = XmlObject.Factory.parse(res.getInputStream(),opts);Is there a simple workaround or explanation? I simply need to be able to parse that second set of XML.thanks for any help or advice.

