[Home] [By Thread] [By Date] [Recent Entries]
On 03/04/2013 14:08, Wolfgang Laun wrote:
Using XSLT 2, this combination: Within the body of the document just copying comments is fine but before or after the document element white space nodes are not generated as the default XDM generation does not consider white space children of the root node to be significant (and of course there are no other text node children of the root node in a well formed document. So what I do is have two templates <xsl:template match="/comment()" priority="2"> <xsl:copy-of select="."/><xsl:text> </xsl:text> <xsl:text>
Of course this doesn't preserve newlines around initial comments it just adds a newline whether there was one there or not but it works OK in practice. Sometimes I also have <xsl:template match="/" priority="2"> <xsl:text> </xsl:text> <xsl:apply-templates/> <xsl:text> as well to get a newline at the start David
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|

Cart



