• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 799
  • Last Modified:

Perl XML::XSLT Error get-node-from-path: Don't know what to do with path

Hi there,

I am getting the following error when I try to run a perl script that uses an XSL stylesheet to transform an XML feed.

get-node-from-path: Don't know what to do with path /$year <= 2150 !!!

I am using the same XSL and XML files in a Java implementation and a PHP implementation of the application and I do not encounter any problems. It looks like the perl processor is having a problem with the following line in the XSL
<xsl:if test="$year &lt;= 2150">
$year is a param that has been passed to the template. See the attach code snippet for more details.




<xsl:call-template name="incrementYear">
   <xsl:with-param name="year">2008</xsl:with-param>
</xsl:call-template>
 
 
<xsl:template name="incrementYear">
       <xsl:param name="year"/>
           <xsl:if test="$year &lt;= 2150">
                application specific logic is here
            </xsl:if>
             <xsl:call-template name="incrementYear">
             <xsl:with-param name="year" select="$year + 1"/>
         </xsl:call-template>

Open in new window

0
2djohn
Asked:
2djohn
  • 2
1 Solution
 
ozoCommented:
the documentation for  XML::XSLT says that support for  xsl:if   is limited
0
 
2djohnAuthor Commented:
Thanks for your input ozo. I seen the man page says the support is limited for both xsl:if and xsl:when. I'm interested in finding a workaround either in Perl or XSL which will allow me to achieve the same result as illustrated in the attached sample code.
0
 
xkcdCommented:
Try to use sequences. But maybe it's available only in xslt 2.0.

<xsl:function name="my:func">
  <xsl:param name="year">
  <!-- your logic here -->
</xsl:function>

...
<xsl:value-of select="for $year in (2008 to 2150) return my:func($year)"/>
0
 
2djohnAuthor Commented:
The Perl XSLT Processor provided here

http://www.dopscripts.com/doc/description.html

processes my XLT files without any problems.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now