开发者

<?xml-stylesheet?> if given before <?xml?> doesn't work in firefox

开发者 https://www.devze.com 2022-12-21 03:29 出处:网络
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 FileOut

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 i开发者_如何学编程n 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消