[Home] [By Thread] [By Date] [Recent Entries]
ok I think i spoke too fast. I forogot another condition. What if there is a <travel1> tag without any condition in it, but I still want to count it in sequence with the ones which satisfy the condition? That is: <travel1> <location <place>NY<place> <time>EST</time> </location> <travel2> <location <place>CaL<place> <time>PST</time> </location> </travel2> </travel1> <travel1> <location <place>Chi<place> <time>CST</time> </location> </travel1> <travel1> <location <place>NY<place> <time>EST</time> </location> </travel1> <!-- This is the travel1 without any condition that needs to be counted--> <travel1> <text>Some text</text> </travel1> I used <xsl:number from="/" count="travel1[location/time=$time and location/place=$place]"/> This counts only those travel1 tags which satisfy the conditions and gives an output like this: 1. NY, EST 2. NY, EST Now since I have another <travel1> tag without any conditions around it, I want that to be counted as #3 and not as #4. But now, i get 1. NY, EST 2. NY, EST 4.Some text Instead I want to count this sequentially with the <travel1> tags which have the place and time conditions satisfied. So I would want: 1. NY, EST 2. NY, EST 3.Some text I tried: <xsl:template match="travel1"> <xsl:choose> <xsl:when test=".//location">
<xsl:if test=".//location/place=$place and .//location/time=$time">
<fo:list-block space-before="6pt" space-before.conditionality="retain">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number format="1"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()" end-indent="0pt">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:if>
</xsl:when>
<!-- This is for the <travel tags without any cnditions-->
without any condition in it, but I still want to count it in sequence
with the ones which satisfy the condition?That is: <travel1> <location <place>NY<place> <time>EST</time> </location> <travel2> <location <place>CaL<place> <time>PST</time> </location> </travel2> </travel1> <travel1> <location <place>Chi<place> <time>CST</time> </location> </travel1> <travel1> <location <place>NY<place> <time>EST</time> </location> </travel1> <!-- This is the travel1 without any condition that needs to be counted--> <travel1> <text>Some text</text> </travel1> I used <xsl:number from="/" count="travel1[location/time=$time and location/place=$place]"/> This counts only those travel1 tags which satisfy the conditions and gives an output like this: 1. NY, EST 2. NY, EST Now since I have another <travel1> tag without any conditions around it, I want that to be counted as #3 and not as #4. But now, i get 1. NY, EST 2. NY, EST 4.Some text Instead I want to count this sequentially with the <travel1> tags which have the place and time conditions satisfied. So I would want: 1. NY, EST 2. NY, EST 3.Some text I tried: <xsl:template match="travel1"> <xsl:choose> <xsl:when test=".//location">
<xsl:if test=".//location/place=$place and .//location/time=$time">
<fo:list-block space-before="6pt" space-before.conditionality="retain">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number from="/"
count="travel1[location/time=$time and location/place=$place]"
format="1"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()" end-indent="0pt">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<fo:list-block space-before="6pt" space-before.conditionality="retain">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:number from="/" count="travel1" format="1"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()" end-indent="0pt">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block></xsl:otherwise> </xsl:choose> </xsl:template> On 1/10/07, David Carlisle <davidc@xxxxxxxxx> wrote:
|

Cart



