xsl:element generates an extra linebreak

In a previous post I’ve described how you can generate dynamic output elements with xsl:element instruction. Unfortunately, the xsl:element generates a newline before the element name (in Saxon and in MSXML) if you use HTML output (xsl:output with method=’html’), resulting in extra line breaks in Blogger (I was developing Word-to-Blogger converter). The only workaround is to use the method=’xml’ with no XML declaration:

<xsl:output method=’xml’ omit-xml-declaration=’yes’)

I didn’t want to have the <?xml ?> heading in the document as I’m pasting the transformation results straight into Blogger.

No comments:

Post a Comment