[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-02-13
4
Medium Priority
?
794 Views
Last Modified: 2013-11-18
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
Comment
Question by:2djohn
  • 2
4 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 23639696
the documentation for  XML::XSLT says that support for  xsl:if   is limited
0
 

Author Comment

by:2djohn
ID: 23644863
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
 
LVL 1

Expert Comment

by:xkcd
ID: 23645622
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
 

Accepted Solution

by:
2djohn earned 0 total points
ID: 23709267
The Perl XSLT Processor provided here

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

processes my XLT files without any problems.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question