Re: [xsl] Trouble With Multiple File Outputs Based on Letter

Subject: Re: [xsl] Trouble With Multiple File Outputs Based on Letter
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 16 May 2002 22:39:02 +0200
PHP User wrote:
Currently I am running it through XT, but that's not a necessity, so I can switch processors.

You should do this, your style sheet contains numerous syntax errors which apparently XT, being somewhat outdated, doesn't care about. Be aware that you are using a XT extension, other processors may have a slightly different syntax or no such extension at all (Xalan and Saxon have).

<xsl:variable name="initTitle" select="substring(//did/unittitle/title,'1','1')" />
                                                ^^^^^^^^^^^^^^
Here appearss to be your problem: the first argument to
the substring function is the node set of all the title
elements in the document, the substring will only take
the first, therefore the initTitle variable has always
the same value (probably an 'A')


Furthermore:
                 <xsl:call-template name="page">
		    <xsl:value-of select="$sTitle" />
		 </xsl:call-template>

That's several syntax errors rolled into one line.


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

That's a no-op. Just omit it.


          <xsl:param name="lett" select="$lett" />
          <xsl:param name="sTitle" select="$Title" />

Also syntax errors.


Probably you need

<xsl:template name="page">
  <html>
    <head><title>The Letter <xsl:value-of select="." /></title></head>
    <body>
      <xsl:variable name="lett_case_mod" select="translate(.,'abcdef...','ABCDEF...')" />
      <xsl:for-each select="//did/unittitle[
        translate(substring(title,1,1),'abcdef...','ABCDEF...')=$lett_case_mod]">
        <h1><xsl:value-of select="title" /></h1>
        <xsl:call-template name="showbox"/>
      </xsl:for-each>
    </body>
  </html>
</xsl:template>

J.Pietschmann




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread