You haven't supplied the full text of the error message, and you haven't explain what your extension functions do, so it's not possible to give a definitive answer. However, this code looks highly dubious:

<xsl:variable name="te" select="test"/>
<xsl:for-each select="test">
   <xsl:choose>
   <xsl:when test="$te/references/reference[type='1']/value != ''">

I would expect the xsl:when to be looking at the current test element, not at the set of all test elements, which is what $te selects. Perhaps you should replace "$te" with ".".

Declaring the types of your variables is strongly recommended. If you had declared

<xsl:variable name="te" select="test" as="element(test)"/>

then you would have received a much more specific error message, closer to the point of your actual coding mistake.

Michael Kay
Saxonica




On 10/01/2011 03:33, Shashikant-Sadashiv Jadhav wrote:

Hi There,
I am getting below error. Please help to understand.
{I have some old XSL which is compatible to XALAN and using similar kind of code and working properly}
Example xml:
<?xml version="1.0"?>
<doc>
<foo>c:\foo.out</foo>
<main>Everything else</main>
<main>Everything else</main>
<test>
<test1>Shashi</test1>
<references>
<reference>
<type>1</type>
<value>Shashi</value>
</reference>
<reference>
<type>2</type>
<value>Jadhav</value>
</reference>
</references>
</test>
<test>
<test1>Shashi</test1>
<references>
<reference>
<type>1</type>
<value>Shashi1</value>
</reference>
<reference>
<type>2</type>
<value>Jadhav1</value>
</reference>
</references>
</test>
</doc>

XSL:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" version="2.0" xmlns:support="java:com.db.prisma.xslt.utilities.XsltSupport" exclude-result-prefixes="support"
extension-element-prefixes="support saxon">
<xsl:output encoding="ISO-8859-1" method="text"/>
<xsl:variable name="newInst" select="support:new()"/>
<xsl:template match="/doc">
<xsl:variable name="te" select="test"/>
<xsl:for-each select="test">
<xsl:choose>
<xsl:when test="$te/references/reference[type='1']/value != ''">
<xsl:call-template name="test">
<xsl:with-param name="t" select="$te"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="test">
<xsl:param name="t"/>
<xsl:value-of select="support:getATFormatText($t/references/reference[type='1']/value)" />
<xsl:value-of select="'New line--------------- '"/>
</xsl:template>
</xsl:stylesheet>



Thanks & Regards,
Shashi
======================================
Deutsche Bank,
Singapore.
Telephone:
Office : +65-6423-4175
Fax : +65-6423-6745
e-mail: Shashikant-Sadashiv.jadhav@db.com
alternate: Shashikant.jadhav@oracle.com
------------------------------------------------------------------------------------------------------------------------------------------

This mail is transmitted to you on behalf of Oracle Financial Services Software Limited

Diese Post wird Ihnen im Namen der Oracle Financial Services Software Limited ubermittelt

------------------------------------------------------------------------------------------------------------------------------------------

---

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help