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

Trying to find following sibling that ends in punctuat

Subject: Trying to find following sibling that ends in punctuation
From: "Marijan (Mario) Madunic" <hajduk@xxxxxxxx>
Date: Fri, 03 Nov 2006 16:43:47 -0800
find a sibling
Using XSLT 2, XPath 2, and Saxon8

I'm trying to get the count(of preceding::*) of a following sibling node that ends with some sort of punctuation, and throw this value into a variable.

I've created a recurisive template

<xsl:template name="ct_PositionOfNodeThatEndsWithPunct">

<!-- set a default value for p_Node -->
<xsl:param name="p_Node" select="following-sibling::*[self::P][1]" />


<!-- test what the element ends with --> <xsl:variable name="l_EndsWith" select="f:f_StringEndsWith($p_Node)" />

<xsl:choose>
<xsl:when test="$l_EndsWith = 'noPunct'">
<xsl:call-template name="ct_PositionOfNodeThatEndsWithPunct">
<xsl:with-param name="p_Node" select="following-sibling::*[self::P][1]" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="count(preceding::*) + 1" /></xsl:otherwise>
</xsl:choose>


</xsl:template>

Now I was hoping that because called templates are context sensitive I can keep on just doing "select="following-sibling::*[self::P][1]" as I've done to give p_Node a new value to iterate through. I keep on getting out of memory error. Memory is not an issue as from my past experiences when I get this error when I introduce a recursive template usually means I've given the recursion no way out. But I can't see why this is happening.

Any insight will be greatly appreciated.

Thanks

Mario

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.