tags:

views:

84

answers:

1

i am generating an XML file using JAXB. First i write a <?xml-stylesheet?> instruction to FileOutputStream and then marhal my data to this FileOutputStream. i specify the name of file in FileOutputStream with .xml extension.

Now, my xml gets generated as desired and works fine in IE but fails in Firefox. Seems that Firefox expects <?xml?> as the first line where as in my case i've <?xml-stylesheet?> tag and then <?xml version="1.0" encoding="UTF-8" standalone="yes"?> tag.

i've to generated xml using JAXB and also add info to it. Please tell how can i do it.

+1  A: 

Use processingInstruction() to add it in instead of spewing out your own.

Ignacio Vazquez-Abrams
can u plz tell me how should i generate my xml using jaxb and add xml-stylesheet tag as well?
magic1234
Not a clue. Try calling `processingInstruction()` before any other functions.
Ignacio Vazquez-Abrams
@magic1234: Can u plz stp usng IRC style lingo here? Its rly hrd 2 rd.
Tomalak