[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Need a little help with xsl:evaluate

Subject: Need a little help with xsl:evaluate
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Jun 2024 09:15:23 -0000
 Need a little help with xsl:evaluate
Hi Folks,

I want to evaluate the XPath expression that is inside the <predicate>
element:

<mappings>
    <mapping>
        <Airport_Name>GENERAL EDWARD LAWRENCE LOGAN </Airport_Name>
        <name>GENERAL EDWARD LAWRENCE LOGAN</name>
        <predicate>normalize-space(../Airport_Name) eq ../name</predicate>
    </mapping>
</mappings>

Here's how I tried to evaluate the XPath expression:

<xsl:template match="/">
      <verification-results>
            <xsl:for-each select="/mappings/mapping/predicate">
                <result-of-evaluating-predicate>
                    <xsl:evaluate xpath="."/>
                </result-of-evaluating-predicate>
            </xsl:for-each>
      </verification-results>
</xsl:template>

When I execute the template rule, I get this error message:

Error in xsl:evaluate/@xpath
XPDY0002  Dynamic error in expression {normalize-space(../Airport_Name) eq
../name} called
  using xsl:evaluate. Caused by net.sf.saxon.trans.XPathException: The context
item for axis
  step ./parent::(element()|document-node()) is absent. Found while atomizing
the first
  argument of fn:normalize-space()

What am I doing wrong? How to fix it?

/Roger

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.