Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Newbie Question

From: "Joseph J. Kesselman" <keshlam-nospam@-------.--->
To: NULL
Date: 7/1/2008 3:29:00 PM

rhino wrote:
> <p><xsl:value-of select="firstname"/><xsl:value-of select="lastname"/></p>
> So, how do I get a blank space to appear between firstname and lastname?

The most straightforward solution is:

<p><xsl:value-of select="firstname"/><xsl:text> </xsl:text><xsl:value-of 
select="lastname"/></p>

This is necessary because whitespace in stylesheets is normally 
discarded unless it's next to non-whitespace text. Wrapping the literal 
whitespace in <xsl:text> tells the processor "I really want this to be 
output exactly as it appears here."

There are other ways to do it, of course -- anything that generates a 
whitespace value will accomplish the task -- but this is the one that 
will make the stylesheet easiest for a human to read.

FWIW, we've seen a number of cases where the tutorials at w3schools have 
been ... well, let's be charitable and say "incomplete". They may have 
improved since then, but you might want to consider looking at other 
sources as well or instead. My standard recommendation is the 
DeveloperWorks XML site, http://www.ibm.com/xml, but I admit to being 
biased.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent