Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Newbie Question

From: "rhino" <No.offline.contact.please@---------.--->
To: NULL
Date: 7/1/2008 2:41:00 PM

I am beginning to learn XML and XSLT from the w3schools tutorial and I'm 
having a lot more trouble doing something simple than I should be, namely 
writing a single blank space into a document. I am trying to separate two 
strings with a space and nothing I'm doing works.


Here is my XSLT, which I think you'll agree is really simple::
<?xml version="1.0" encoding="Windows-1252"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="attendance">

<html>

<body>

<xsl:for-each select="meeting">

<h2><xsl:value-of select="date/year"/>-<xsl:value-of 
select="date/month"/>-<xsl:value-of select="date/day"/></h2>

<xsl:for-each select="attendee">

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

</xsl:for-each>

<p>Total Attendees: <xsl:value-of select="count(attendee)"/></p>

</xsl:for-each>

</body>

</html>

</xsl:template>

</xsl:stylesheet>


It works perfectly except that I can't figure out how on earth to put a 
single blank between the firstname and lastname within the for-each loop for 
attendee. I've tried putting a single blank and multiple blanks into the 
document via the space bar but, as normal for HTML, the white space gets 
squeezed out. I tried using &nbsp; and then the document wouldn't appear at 
all. In fact, I got a message that there was no document at all! I 
eventually stumbled on this page, 
http://www.w3schools.com/xml/xml_syntax.asp, which implies but doesn't say 
explicity, that ONLY the five entitites stated there are permissible. 
Presumably, that is why the document wasn't perceived when I used &nbsp; in 
the XSLT.

So, how do I get a blank space to appear between firstname and lastname? I 
have to believe this is possible but I have no idea how it could be done.

Can someone help me out? I'd be quite happy if someone could point me to a 
topic in a tutorial that might show me how that could be done.

--
Rhino




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