[Home] [By Thread] [By Date] [Recent Entries]
On 02/05/2024 15:08, Roger L Costello costello@xxxxxxxxx wrote:
Hi Folks,value 'DNKK'. My program outputs the element and the name of its parent: below.
invoke Java. But I wonder if there a way to write my program so that it is more efficient (i.e., doesn't require so much memory)?
B <xsl:param name="search-term" as="xs:string" select="'DNKK'"/> B <xsl:output indent="yes"/> B <xsl:mode streamable="yes" on-no-match="shallow-skip" use-accumulators="#all"/> B <xsl:accumulator name="string-value" as="xs:string?" initial-value="()" streamable="yes"> B B B <xsl:accumulator-rule match="*" select="()"/> B B B <xsl:accumulator-rule match="text()" select="$value || ."/> B </xsl:accumulator> B <xsl:template match="*">
B B B <xsl:apply-templates/>
B B B <xsl:variable name="string-value"
select="accumulator-after('string-value')"/>
B B B <xsl:if test="not(empty($string-value)) and $string-value =
$search-term">
B B B B B B <result>
B B B B B B B B <xsl:copy>{$string-value}</xsl:copy>
B B B B B B B B <parent>{node-name(..)}</parent>
B B B B B B </result>
B B B </xsl:if>
B </xsl:template></xsl:stylesheet>
|

Cart



