Loading ...
Sorry, an error occurred while loading the content.

Index group that doesn't start with alpha character

Expand Messages
  • Carolyn
    I ve got my alpha index working correctly for all titles except those starting with a non-alpha character. Grouping is new to my to forgive me if this is
    Message 1 of 2 , Sep 18 7:25 AM
    • 0 Attachment
      I've got my alpha index working correctly for all titles except those
      starting with a non-alpha character.

      Grouping is new to my to forgive me if this is confusing. I've
      created a key for the first character of the element to index.

      <xsl:key name="dfpletter"
      match="csn[@item!='0']/isn/pnr[@hardware!='1']"
      use="substring(following-sibling::pas/dfp,1,1)"/>

      And for my index I'm using:

      <xsl:call-template name="toc">
      <xsl:with-param name="firstletter" select="'A'"/>
      </xsl:call-template>
      <xsl:call-template name="toc">
      <xsl:with-param name="firstletter" select="'B'"/>
      </xsl:call-template>

      etc.

      ************

      My toc template creates the table entries with:

      <xsl:template name="toc">
      <xsl:param name="firstletter"/>
      <xsl:for-each select="key('dfpletter', $firstletter)">
      <xsl:sort select="following-sibling::pas/dfp"/>
      <xsl:if test="position()=1">
      <fo:table-row vertical-align="middle" line-height="0.375in"
      keep-with-next="always">
      <fo:table-cell column-number="1" number-columns-spanned="3">
      <fo:block font-weight="bold" text-align="center">
      <xsl:value-of select="$firstletter"/>
      </fo:block>
      </fo:table-cell>
      </fo:table-row>
      </xsl:if>
      <fo:table-row keep-together.within-column="always">
      <fo:table-cell column-number="1">

      etc.

      **********

      How can I capture the keys that do not equal an alpha?
    • J.Pietschmann
      ... [snip] ... Let the tool figure it out. instead of calling the toc template for each character, use Munchean grouping:
      Message 2 of 2 , Sep 18 3:57 PM
      • 0 Attachment
        Carolyn wrote:
        > I've got my alpha index working correctly for all titles except those
        > starting with a non-alpha character.
        [snip]
        > How can I capture the keys that do not equal an alpha?

        Let the tool figure it out. instead of calling the toc
        template for each character, use Munchean grouping:
        http://www.jenitennison.com/xslt/grouping/index.html
        or use XSLT 2.
        In either case, XSLT questions are best asked on the Mulberry
        XSL list:
        http://www.mulberrytech.com/xsl/xsl-list/

        J.Pietschmann
      Your message has been successfully submitted and would be delivered to recipients shortly.