You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Davor Cengija <da...@mail.inet.hr> on 2001/01/08 13:52:21 UTC

Xalan-J 2 bug

        According to people from comp.text.xml, this might be a bug:

        Spaces in <xsl:with-param> are ignored even when explicitly
        asked to preserve them.

        Here's my template:

  <xsl:template name="lnk">

    <xsl:param name="url"/>
    <xsl:param name="title"/>
    <xsl:param name="jsessionid"/>
    <xsl:element name="a">
      <xsl:attribute name="href">
        <xsl:value-of select="$url"/><xsl:value-of select="$jsessionid"/>
      </xsl:attribute>
      <xsl:value-of select="$title"/>
    </xsl:element>
  </xsl:template>


        And here's how I call it:

  <xsl:template match="row">
    <tr>
      <td align="right"><xsl:number/></td>
      <td>
          <xsl:call-template name="lnk">
            <xsl:with-param name="jsessionid"><xsl:value-of select="$jsessionidparam"/></xsl:with-param>
            <xsl:with-param name="url"><xsl:value-of select="$link"/>/list/<xsl:value-of select="modelkod"/>.html</xsl:with-param>
             <xsl:with-param name="title" xml:space="preserve">
              <xsl:value-of select="tip"/><xsl:text> </xsl:text><xsl:value-of select="model"/>
             </xsl:with-param>

              <!-- This works  just fine
              <xsl:with-param name="title" select="concat(tip, ' ', model)"/>
              -->
          </xsl:call-template>
         </td>
    </tr>
  </xsl:template>


        So, parameter $title has 2 <xsl:value-of/> elements and an
        <xsl:text/> element containing one (or more spaces) only. That
        space is stripped. I tried different combinations (with
        xml:preserve, without it, with different <xsl:text/> forms),
        all without success.

        I'm using Xalan 2 D05 (and just tried with D06, no
        difference), Xerces 1.2.3 on Linux IBM JDK 1.3.0

        Template "lnk" is defined in a separate file, which is
        included by the main .xsl and then processed. This is the only
        problem I found so far.

        Thanks.
-- 
Davor Cengija
davor.cengija@mail.inet.hr