xsl-list
[Top] [All Lists]

[xsl] xsl:number query

2010-03-08 15:49:26
I am having trouble getting an accurate count using xsl:number.

Here is a snippet of my input document:

<div class="story">
                                <p class="test">A</p>
                                <p class="head-testname">READING 
COMPREHENSION</p>
<p class="bodytext-directionsrevise">Directions: Read the selection. Then answer the questions that follow.</p>
                                <p class="head-selectiontitle">Jason and the Golden 
Fleece</p>
                                   ...
<p class="bodytext-directionsrule1">Directions: Read the selection. Then answer the questions that follow.</p>
                                <p class="head-selectiontitle">Freight</p>
<p class="bodytext-selectionintro">This is an ... Underground Railroad.</p>
                                <p class="bodytext-subhead">Cast of 
Characters</p>
</div>

I am attempting to include in the same sequence both <p class="bodytext-directionsrevise"> and <p class="bodytext- directionsrule1">.

Here is the relevant template from my 2.0 stylesheet:

<xsl:template match="p[(_at_)class='bodytext-directionsrevise'] | p[(_at_)class='bodytext-directionsrule1']">
<narrative>
<xsl:attribute name="name"><xsl:number select="." count="*" from="story"></xsl:number></xsl:attribute>
<xsl:apply-templates/>
</narrative>
</xsl:template>


Apparently, I am counting <p> elements, as indicated by this result snippet:

<story>
            <test>A</test>
            <head-testname>READING COMPREHENSION</head-testname>
<narrative name="3">Directions: Read the selection. Then answer the questions that follow.</narrative>
...
<narrative name="82">Directions: Read the selection. Then answer the questions that follow.</narrative>

How can I tell xsl:number to count the specified attributes?

Terry


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>