• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

removing first line from JAXB generated XML

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

I am using JAXB and generating XML.
The XML contains "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" at the first line as
it should be but my question is :
Is there any way to remove that line and i want only the XML part without this
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"

Could anybody please give me an idea how to get that

Thanks
Vamshi
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running it through an XSLT identity transformation with <xsl:output omit-xml-declaration="yes"/> should work. Or there's a TRAX equivalent of that if you are working in Java.

But before you do that you should really examine why it's necessary to omit the XML declaration. Is there really a need for that?
 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul for the reply,

Actually i need to send the XML by omiting the XML declaration to SOAP.
thats the reason i need an XML without XML declaration.
I am looking into TRAX as you said, could you please tell me if have any idea how to do that.


Thanks
Vamshi
 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks i got it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic