Re: Unable to get the top element of an XML
Amila, I am using Plain Java Object that doe not include any Factory. even Helper class does not include and Factory definition that is the reason i am unable to utilize the Factory.parse(). Please advice me how to get Factory on Plan Java objects Thanks Sunny Amila Suriarachchi wrote: if you give me your schema I can help you more. instead of using the Helper use TopElement.Factory.parse() method to create the object and use TopElement.getOMElement() method to get the OM Element. please see some ADB test classes. Amila. On 6/28/07, Sunny44 [EMAIL PROTECTED] wrote: I have created the ADB object using ADB code generator. (PLAIN JAVA). My unit test works in following manner It UnMarshall the Input XML to OBJECTS and from OBJECT to XML But the Problem is in the result XML is 1 It does not include the top element. 2 It contains xsi:nil in reoccurring element headers. Sample code UN-Marshall reader = XMLInputFactory.newInstance().createXMLStreamReader( new ByteArrayInputStream(this.inputXML.getBytes())); Object returnObj = Helper.parse(reader); - WORKS MARSHALLER XMLStreamReader reader = Helper.getPullParser(ci, ContentItemsHelper.MY_QNAME); OMElement omElt = new StAXOMBuilder(reader).getDocumentElement(); String xml = omElt.toString(); xml string does not contain the header element Sample XML items xmlns:p=bla bla xmlns:xsi=bla bla - MISSING item id1234/id item /items --- MISSING Please advice how do i get the Top ELEMENT Thanks Sunny -- View this message in context: http://www.nabble.com/Unable-to-get-the-top-element-of-an-XML-tf3995959.html#a11348317 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Amila Suriarachchi, WSO2 Inc. -- View this message in context: http://www.nabble.com/Unable-to-get-the-top-element-of-an-XML-tf3995959.html#a11365412 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unable to get the top element of an XML
I have created the ADB object using ADB code generator. (PLAIN JAVA). My unit test works in following manner It UnMarshall the Input XML to OBJECTS and from OBJECT to XML But the Problem is in the result XML is 1 It does not include the top element. 2 It contains xsi:nil in reoccurring element headers. Sample code UN-Marshall reader = XMLInputFactory.newInstance().createXMLStreamReader( new ByteArrayInputStream(this.inputXML.getBytes())); Object returnObj = Helper.parse(reader); - WORKS MARSHALLER XMLStreamReader reader = Helper.getPullParser(ci, ContentItemsHelper.MY_QNAME); OMElement omElt = new StAXOMBuilder(reader).getDocumentElement(); String xml = omElt.toString(); xml string does not contain the header element Sample XML items xmlns:p=bla bla xmlns:xsi=bla bla - MISSING item id1234/id item /items --- MISSING Please advice how do i get the Top ELEMENT Thanks Sunny -- View this message in context: http://www.nabble.com/Unable-to-get-the-top-element-of-an-XML-tf3995959.html#a11348317 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to get the top element of an XML
if you give me your schema I can help you more. instead of using the Helper use TopElement.Factory.parse() method to create the object and use TopElement.getOMElement() method to get the OM Element. please see some ADB test classes. Amila. On 6/28/07, Sunny44 [EMAIL PROTECTED] wrote: I have created the ADB object using ADB code generator. (PLAIN JAVA). My unit test works in following manner It UnMarshall the Input XML to OBJECTS and from OBJECT to XML But the Problem is in the result XML is 1 It does not include the top element. 2 It contains xsi:nil in reoccurring element headers. Sample code UN-Marshall reader = XMLInputFactory.newInstance().createXMLStreamReader( new ByteArrayInputStream(this.inputXML.getBytes())); Object returnObj = Helper.parse(reader); - WORKS MARSHALLER XMLStreamReader reader = Helper.getPullParser(ci, ContentItemsHelper.MY_QNAME); OMElement omElt = new StAXOMBuilder(reader).getDocumentElement(); String xml = omElt.toString(); xml string does not contain the header element Sample XML items xmlns:p=bla bla xmlns:xsi=bla bla - MISSING item id1234/id item /items --- MISSING Please advice how do i get the Top ELEMENT Thanks Sunny -- View this message in context: http://www.nabble.com/Unable-to-get-the-top-element-of-an-XML-tf3995959.html#a11348317 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Amila Suriarachchi, WSO2 Inc.