|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: need help outputing summary of head elements
> <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
________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








