This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm trying to use Transformer in order to convert a DOM Node into a string. This works, but unfortunately it sticks the xml header at the beginning of the string : < ?xml ... > For my particular application, I don't need this xml header. So how do you tell the transformer to avoid printing it ?
If you were doing an XSLT transformation, then you would use <xslutput omit-xml-declaration="yes"/>. So in your code I would tryThat's my best guess.
Bear in mind that the transformer cannot omit the XML declaration unless the encoding of the document it is writing is UTF-8. Any other encoding has to be specified in an XML declaration. [ February 05, 2006: Message edited by: Paul Clapham ]