पुनः असाइन करने योग्य चर एक संचायक, XSLT संस्करण 3.0 से उपलब्ध का उपयोग कर की घोषणा की जा सकती है। :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="3.0" >
<xsl:mode use-accumulators="variable2" streamable="no"/>
<xsl:output omit-xml-declaration="no" indent="yes"/>
<xsl:accumulator name="variable2" initial-value="'N'">
<xsl:accumulator-rule match="Inpayment" select="if ($value = 'N' and @tip = '2') then 'Y' else 'N' "/>
</xsl:accumulator>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Inpayment">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:value-of select="accumulator-before('variable2')"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
स्रोत
2017-09-27 11:07:30
मुझे क्या करने की ज़रूरत है? धन्यवाद –