Using XSLT, How do I display a single space between my two XML elements? &nsbp and spacing do not fix it

Viewed 1623

I want to display a space between the first name and last name, such that the output displays

Name: Richard Simmons

But right now, I am getting

Name: RichardSimmons

For some reason, nothing I do can add a space into the display.

I can post the full code but I suspect the spacing has to do with how I call "apply-templates" in my XSLT.

Here is the XSLT that displays name

<xsl:template match="scout">
<div style="border-style:solid; width: 60%; margin: 0% 0% 20px 35%;">
  <!--NAME-->
  <p style="font-weight: bold">
    Name: <span style="font-weight: normal"><xsl:apply-templates select="firstName"/></span><!--I want to put a space here-->
          <span style="font-weight: normal"><xsl:apply-templates select="lastName"/></span>
  </p>
<!-- More stuff-->
</div>
</xsl:template>

<xsl:template match="firstName">
    <xsl:value-of select="node()"/> 
</xsl:template>

<xsl:template match="lastName">
    <xsl:value-of select="node()"/>
</xsl:template>

I have tried simply adding a space and including "&nbsp" with no success.

EDIT: Relevant XML if anyone's interested

<bsa>
  <council name="Movies">
    <troop name="Pixar" number="a113">
      <scout>
        <firstName>Philip</firstName>
        <lastName>Sherman</lastName>
        <address>
          <street>42 Wallaby Way</street>
          <city>Sydney</city>
          <state>New South Wales</state>
        </address>
        <phone>77437626</phone>
        <rank date-earned="2004">Eagle</rank>
        <meritbadge date-earned="2004">Fish in my hair!</meritbadge>
      </scout>
    </troop>
  </council>
  </bsa>
2 Answers
Related