[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: need help outputing summary of head elements

Subject: Re: need help outputing summary of head elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 19 Sep 2005 13:13:05 +0100
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
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.