• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

remove <xml fragment> xml beans

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have data in DB and an xsd.

I am using xmlbeans to generate xmls from the above information.

Everything is fine except for the <xml-fragment> tag that get generated in the XML string.

So instead of
<Employee>
<FName>Praveen</FName>
</Employee>

I get
<xml-fragment>
<Employee>
<FName>Praveen</FName>
</Employee>
</xml-fragment>

how do I get rid of the additional tags???

Please help.

I have lost quite a lot of time working on this but no good.

Thanks in advance




 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you get the result as a java.lang.String?
 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Madhan,

Thanks for the reply Yes i did get the result as java.lang.string

I actually need an org.w3c.dom.Document object instead of the string.

I retrived the String to print it to the console.

Please help me how to get through this.

Thanks in advance.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use String.substring method to extract the content you want and do the needful.
 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there no API in XMLBean that would return me a org.w3c.dom.Document directly without me doing the extraction explicitly???

I trid looking but did not find anything.

Just that if there is something already available, I dont have to worry too much else i'll have to test the custom implementation thoroughly...

Thanks for the suggestion

Praveen
 
Marshal
Posts: 26586
81
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rajkumar Katudia wrote:Thanks for the reply Yes i did get the result as java.lang.string

I actually need an org.w3c.dom.Document object instead of the string.

I retrived the String to print it to the console.

Please help me how to get through this.



Why not just parse the String into a Document, using a DocumentBuilder, then?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic