Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Newbie Question Newbie QuestionTo: 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 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 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
