permaculture playing cards*
The moose likes XML and Related Technologies and the fly likes removing first line from JAXB generated XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "removing first line from JAXB generated XML" Watch "removing first line from JAXB generated XML" New topic
Author

removing first line from JAXB generated XML

vamshidhar nimbagiri
Ranch Hand

Joined: Oct 04, 2004
Posts: 61
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


Thanks,
Vamshidhar Nimbagiri
SCJP 5.0
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Running it through an XSLT identity transformation with <xslutput 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

Joined: Oct 04, 2004
Posts: 61
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

Joined: Oct 04, 2004
Posts: 61
Thanks i got it.
 
GeeCON Prague 2014
 
subject: removing first line from JAXB generated XML