Support #1343
closedToo many nested apply templates
0%
Description
SourceForge user: geoffhopkins
Error will become apparent when running XSLT with XML
source... if one line is removed the
program works ok... Can't provide the true source for
confidentiality reasons,,, the true source is actually
7000 lines between point A and B.
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform
">
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="SSDD_START">Application Software
Requirements</xsl:variable>
<xsl:variable name="SSDD_STOP">Service Function
Requirements</xsl:variable>
<xsl:variable name="REQ_START">R[</xsl:variable>
<xsl:variable name="REQ_STOP">]</xsl:variable>
<xsl:param name="DOC_REF"/>
<xsl:template match="pdf2xml">
<root>
<artefact doc_ref="{$DOC_REF}"
doc_type="1">
<xsl:apply-templates
select="text[contains(.,'R[') or contains(.,'Service
Function Requirements') or contains(.,'Application
Software Requirements')][1]"/>
</artefact>
</root>
</xsl:template>
<xsl:template match="text">
<xsl:if test="not(contains(.,$SSDD_START))">
<xsl:if test="starts-with(.,'R[') and
substring(.,string-length(.),1)=$REQ_STOP">
<instance type_id="1">
<xsl:attribute name="doc">
<xsl:value-of
select="$DOC_REF"/>
</xsl:attribute>
<xsl:attribute name="sec">
<xsl:value-of
select="."/>
</xsl:attribute>
</instance>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="following-
sibling::text[1]"/>
</xsl:template>
<xsl:template match="text[contains(.,'Service Function
Requirements')]">
<xsl:apply-templates select="following-
sibling::text[contains(.,$SSDD_START)][1]"/>
</xsl:template>
<xsl:template match="text[1]">
<xsl:apply-templates select="following-
sibling::text[contains(.,$SSDD_START)][1]"/>
</xsl:template>
</xsl:stylesheet>
Files
Please register to edit this issue