Subject: Re: [xsl] When is xsl:text relevant? From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 8 Jun 2005 13:38:54 +0100 |
Would it make more sense to use : <p><xsl:text>Total Amount: </xsl:text></p> Instead of : <p>Total Amount: </p> These two are completely equivalent. There are two reasons for using xsl:text The first one is that people like to indent their stylesheets and if you go <p> <xsl:text>Total Amount: </xsl:text> </p> <p> Total Amount: </p> then the first one is still equivalent to the two above, but the second one has changed the content of the p element adding 2 newlines and some space characters. (Which in this case doesn't change the html rendering, but in general, it might) The other reason is that white space text nodes in a styelesheet are typically ignored, which is why <p> <xsl:text>Total Amount: </xsl:text> </p> is the same as <p><xsl:text>Total Amount: </xsl:text></p> so if you want to add some space then you can use xsl:text as a white space text node of xsl:text is not ignored. <p> </p> will produce <p/> <p><xsl:text> </xsl:text></p> will produce <p> </p> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] When is xsl:text relevant, Sylvain Hellegouarch | Thread | RE: [xsl] When is xsl:text relevant, Jarno.Elovirta |
Re: [xsl] What is exciting in XSLT , Colin Paul Adams | Date | Re: [xsl] What is exciting in XSLT , James Fuller |
Month |