Page 1 of 1

pretty print and <xsl:text> </xsl:text>

Posted: Wed Mar 17, 2004 11:19 pm
by petefc
Hello,

The pretty print function has a very annoying funtion!

if you have a

<xsl:text> </xsl:text>

and then you pretty print it turns in to:
<xsl:text/>

This is bad as there are many times where you are using xsl:text to add a space!

Posted: Thu Mar 18, 2004 12:26 am
by george
Hi Peter,

You have 3 options.

1. <xsl:text><![CDATA[ ]]></xsl:text>
2. <xsl:text xml:space="preserve"> </xsl:text>
3. Add xsl:space to the Options->Preferences Editor/Format/Preserve space elements list and then use <xsl:text> </xsl:text> as you do now.

Option 1 is the most portable form, option 2 is portable only between tools that handle xml:space and option 3 is less portable, requires the same setting with oXygen or an equivalent setting with some other tool.

On the other hand option 3 is the easiest to write, option 2 is a little harder while option 1 is the hardest to write.

I personally use and recommend option 2 as it allows enough portability and it is not hard to write. Also this is very verbose.

Best Regards,
George