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

Having trouble installing Oxygen? Got a bug to report? Post it all here.
petefc
Posts: 16
Joined: Tue Jan 20, 2004 4:07 am

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

Post 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!
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
Post Reply