Hi Kai.

Kai Hennig:
> I want to include an inline SVG (created with Batik) into an XHTML  
> page (via a custom JSF component). Unfortunately there is an XML  
> Declaration (something like <?xml version="1.0" encoding="utf-8"?>)  
> at the beginning of the SVG output of SVGGraphics2D.stream() which is  
> not allowed inside an XHTML document (except in the first line of the  
> doc of course).
> 
> Is there an easy way to prevent the XML Declaration from getting  
> written to the stream? I can't find an easy way to do so. What I am  
> doing now is a time-consuming identity transformation of the SVG with  
> the xsl-output parameter omit-xml-declaration set to "yes".
> 
> Here is a sample code (without the identity transformation workaround)

At the moment, no, there’s no easy way to skip the XML declaration.  You
would have to modify XmlWriter.writeDocumentHeader(IndentWriter).  Or,
you could be particularly tricky, and provide your own implementation of
a Writer to SVGGraphics2D.stream(Element,Writer,boolean,boolean) that
discards all characters up to the second occurrence of a '>', thereby
skipping the XML and DOCTYPE declarations. :)

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to