I have the following XSL file, and I am getting the following error
Instance method call to method increment requires an Object instance as first argument in xsl
Can anyone help me
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" xmlns:func=" extension-element-prefixes="func"
xmlns:my="my://own.uri">
<xslutput method="xml" indent="yes" />
<!-- INDECES -->
<xsl:variable name="childIdx" select="0" /> <!-- child index -->
<func:script language="javascript" implements-prefix="my">
var count = 0;
function increment() {
count++;
return count;
}
</func:script>
<xsl:template match="template">
<!-- begin tree -->
<xsl:text disable-output-escaping="yes">
<tree id="0">
</xsl:text>
<!-- template -->
<xsl:element name="item">
<xsl:variable name="childIdx" select="1+$childIdx"/> <!-- logic need to changed -->
<xsl:attribute name="text">template</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="my:increment()"/>
</xsl:attribute>
<xsl:attribute name="child">
<xsl:value-of select="$childIdx"/>
</xsl:attribute>
<!-- non editable command -->
<xsl:apply-templates select="nonEditableCommand" />
<!-- |editableCommand|module|autofillCommand -->
</xsl:element>
<!-- end tree -->
<xsl:text disable-output-escaping="yes">
</tree>
</xsl:text>
</xsl:template>
<!-- This will apply rules to all Non Editable Commands-->
<xsl:template match="nonEditableCommand">
<xsl:element name="item">
<xsl:variable name="childIdx" select="1+$childIdx"/> <!-- logic need to changed -->
<xsl:attribute name="text">nonEditableCommand</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="my:increment()"/>
</xsl:attribute>
<xsl:attribute name="child">
<xsl:value-of select="$childIdx"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thanks
Mallik
Instance method call to method increment requires an Object instance as first argument in xsl
Can anyone help me
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" xmlns:func=" extension-element-prefixes="func"
xmlns:my="my://own.uri">
<xslutput method="xml" indent="yes" />
<!-- INDECES -->
<xsl:variable name="childIdx" select="0" /> <!-- child index -->
<func:script language="javascript" implements-prefix="my">
var count = 0;
function increment() {
count++;
return count;
}
</func:script>
<xsl:template match="template">
<!-- begin tree -->
<xsl:text disable-output-escaping="yes">
<tree id="0">
</xsl:text>
<!-- template -->
<xsl:element name="item">
<xsl:variable name="childIdx" select="1+$childIdx"/> <!-- logic need to changed -->
<xsl:attribute name="text">template</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="my:increment()"/>
</xsl:attribute>
<xsl:attribute name="child">
<xsl:value-of select="$childIdx"/>
</xsl:attribute>
<!-- non editable command -->
<xsl:apply-templates select="nonEditableCommand" />
<!-- |editableCommand|module|autofillCommand -->
</xsl:element>
<!-- end tree -->
<xsl:text disable-output-escaping="yes">
</tree>
</xsl:text>
</xsl:template>
<!-- This will apply rules to all Non Editable Commands-->
<xsl:template match="nonEditableCommand">
<xsl:element name="item">
<xsl:variable name="childIdx" select="1+$childIdx"/> <!-- logic need to changed -->
<xsl:attribute name="text">nonEditableCommand</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="my:increment()"/>
</xsl:attribute>
<xsl:attribute name="child">
<xsl:value-of select="$childIdx"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thanks
Mallik