White Space Preservation In Xslt
-
I've made an Xslt as a template for a code generator i'm working on. It seems to be getting the bulk of it right, but where i have two Xsl attribute blocks consecutively with only white space in between them, it gets stripped. I had a look around and couldn't find anything. Here is my example:
public <xsl:value-of select="type"/> <xsl:value-of select="name"/> { // Property Logic }
This produces:public DateMyDOB { // Property Logic }
It's lame :( If anyone can help, that'd be great. Cheers Tris------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
I've made an Xslt as a template for a code generator i'm working on. It seems to be getting the bulk of it right, but where i have two Xsl attribute blocks consecutively with only white space in between them, it gets stripped. I had a look around and couldn't find anything. Here is my example:
public <xsl:value-of select="type"/> <xsl:value-of select="name"/> { // Property Logic }
This produces:public DateMyDOB { // Property Logic }
It's lame :( If anyone can help, that'd be great. Cheers Tris------------------------------- Carrier Bags - 21st Century Tumbleweed.
Tris, One way to solve this is to use xsl:text:
public <xsl:value-of select="type"/>xsl:text </xsl:text><xsl:value-of select="name"/>
{
// Property Logic
}You can also use the nonbreaking space character, " " , also.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Tris, One way to solve this is to use xsl:text:
public <xsl:value-of select="type"/>xsl:text </xsl:text><xsl:value-of select="name"/>
{
// Property Logic
}You can also use the nonbreaking space character, " " , also.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Thankyou sir. That'll do nicely.
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
Tris, One way to solve this is to use xsl:text:
public <xsl:value-of select="type"/>xsl:text </xsl:text><xsl:value-of select="name"/>
{
// Property Logic
}You can also use the nonbreaking space character, " " , also.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Ah, so that's how you get a nonbreaking space!! Thanks! I'll have to write that down. I've been using
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
to insert one into HTML. -
Ah, so that's how you get a nonbreaking space!! Thanks! I'll have to write that down. I've been using
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
to insert one into HTML.The entity does not exist in XSLT, so you have to use the code.
"We make a living by what we get, we make a life by what we give." --Winston Churchill