Re: [xsl] need help outputing summary of head elements

Subject: Re: [xsl] need help outputing summary of head elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 19 Sep 2005 13:13:05 +0100
> <xsl:variable name="strRoman" as="xs:string">I. II.
> III. IV. V. VI. VII. VIII. IX. X. XI. XII. XIII. XIV.
> XV.</xsl:variable>

there's no need to make one big string and then have to keep checking
with contains and substring before, just make a list of strings

<xsl:variable name="strRoman" as="xs:string*" select="('I.', 'II.',
'III.', 'IV.', 'V.', 'VI.', 'VII.', 'VIII.', 'IX.', 'X.', 'XI.', 'XII.', 'XIII.', 'XIV.'
)"/>

or simpler,


<xsl:function name="num:roman" as="xs:string">
  <xsl:param name="value" as="xs:integer"/>
  <xsl:number value="$value" format="I."/>
</xsl:function>


<xsl:variable name="strRoman" as="xs:string*"
  select="for $i in (1 to 19) return num:roman($i)"/>

It's difficult to follow the logic of your stylesheet without seeing the
input format, but from your descritption I think you just want something
like the following to seelct all the head eleemnts whose first word is a
roman numeral, then just test that position() != last() to insert the
separator.


<xsl:for-each select="$ParentInfo//div/head[substring-before(.,'')=$strRoman]">
do something with this head
<xsl:if test="position() != last()"> - </xsl:if>
</xsl:for-each>


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread