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

Nested apply-templates calls run out of stack space -

Subject: Nested apply-templates calls run out of stack space - alternative xslt
From: geoff hopkins <geoffhopkins123@xxxxxxxxx>
Date: Mon, 19 Dec 2005 06:59:55 -0800 (PST)
out of stack space
XSLT 1.0

The XSLT below fails as there are too many lines
between the start and the stop (6000 lines in one of
my input docs)....
Nested apply-templates calls run out of stack space. 

I have tried work arounds to no avial.... if anyone
has any insite into creating a new stylesheet that
does not run out of stack space I would be

Mr Kay suggested the following but this is beyond my
personal XSLT knowledge

Define a key for each of the elements that's the
generate-id() of the 
recent preceding sibling that matches "Point A" or
"Point B". Then do
Muenchian grouping using this key. 

the basic premise is that between point SSDD_START and
point SSDD_STOP need to extract information that has
R[xxx] in the data....

SSDD_START and SSDD_STOP can occur once of many times
in the document 

xml in
	<text>Application Software Requirements</text>
	<text>Service Function Requirements</text>
	<text>Application Software Requirements</text>
	<text>Service Function Requirements</text>
xml out - I understand this is not what the xslt is
doing but if you can get to this stage I can work out
the rest.


original xslt
<xsl:stylesheet version="1.0"
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="SSDD_START">Application Software
<xsl:variable name="SSDD_STOP">Service Function
<xsl:variable name="REQ_START">R[</xsl:variable>
<xsl:variable name="REQ_STOP">]</xsl:variable>

<xsl:param name="DOC_REF"/>

<xsl:template match="pdf2xml">
		<artefact doc_ref="{$DOC_REF}" doc_type="1">
			<xsl:apply-templates select="text[1]"/>

<xsl:template match="text">
	<xsl:if test="not(contains(.,$SSDD_START))">
		<xsl:if test="starts-with(.,'R[') and
		<instance type_id="1">
			<xsl:attribute name="doc">
				<xsl:value-of select="$DOC_REF"/>
			<xsl:attribute name="sec">
				<xsl:value-of select="."/>

<xsl:template match="text[contains(.,'Service Function

<xsl:template match="text[1]">


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Current Thread


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.
First Name
Last Name
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.