[xsl] how to match node set with attribute then pass to a template

Subject: [xsl] how to match node set with attribute then pass to a template
From: Biying Huang <biying@xxxxxxxxxxxxxxx>
Date: Fri, 26 Sep 2003 12:24:38 -0400
Hello, all:

In PDF output, I am trying to display 2 images side by side and its info
above each image, but only display images that has the attribute
showImage="true".
But I don't know how to match node set with attribute then pass to a
template.

My XML data:=======================
<AttachmentList>
    <Attachment showImage="true">
        <filename>Image5445.jpg</filename>
        <info>image information</info>
  </Attachment>

  <Attachment showImage="false">
        <filename>Image5446.jpg</filename>
        <info>image information</info>
  </Attachment>

  <Attachment showImage="true">
        <filename>Image5447.jpg</filename>
        <info>image information</info>
  </Attachment>
</AttachmentList>

My xslt templates:===================================

<xsl:template match="AnalyticalList" >
    <xsl:apply-templates select="Attachment[@showImage = 'true']"
mode="AttachImage" />
</xsl:template>

<xsl:template match="Attachment[@showImage = 'true']" >
     ?? what do I do here ??
</xsl:template>

<xsl:template match="Attachment">
  <fo:table-row>
      <fo:table-cell>
        <fo:block><xsl:value-of select="info"/></fo:block>
      </fo:table-cell>

      <fo:table-cell>
        <fo:block>
            <!-- How do I get the next whose showImage="true" here ??
               <xsl:value-of select="following-sibling::Attachment/info"
/>
            -->
        </fo:block>
      </fo:table-cell>
  </fo:table-row>

  <fo:table-row>
      <!-- two images in a row here
  </fo:table-row>

</xsl:template>

Many thanks in advance.

Biying


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


Current Thread