This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transformer - omitting the xml header (" ?xml encoding=.. ?" )

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ?

That's my code so far:



Thanks
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic