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

unction return value not a node?

Subject: unction return value not a node?
From: Bartolomeo Nicolotti <bnicolotti@xxxxxxxxx>
Date: Wed, 08 Sep 2010 17:16:05 +0200
 unction return value not a node?
Hello,

Sorry but XSLT 2.0 and XPath 2.0 book is more than 1000 pages, so I'm
writing this:

I've this xpath expression that returns a node stored in a variable:

    <xsl:variable name="x" select="($airTraveler/preceding-sibling::ota:AirTraveler[@PassengerTypeCode!='INF' and substring( concat( gal:normNames( ota:PersonName/ota:Surname ), concat( gal:normNames( ota:PersonName/ota:GivenName ),gal:normNames( ota:PersonName/ota:NamePrefix ))),1,16) = $srnNP16 ], $airTraveler)[1]"/>


then if I do

    <xsl:value-of select="$x/preceding-sibling::ota:AirTraveler"/>

I obtain the preceding-sibling nodes.

but if I write this function to use the same xpath expression, quite complicated, in two places

  <xsl:function name="gal:func">
    <xsl:param name="airTraveler"/>
    <xsl:param name="srnNP16"/>
    <xsl:value-of select="($airTraveler/preceding-sibling::ota:AirTraveler[@PassengerTypeCode!='INF' and substring( concat( gal:normNames( ota:PersonName/ota:Surname ), concat( gal:normNames( ota:PersonName/ota:GivenName ),gal:normNames( ota:PersonName/ota:NamePrefix ))),1,16) = $srnNP16 ], $airTraveler)[1]"/>
  </xsl:function>

but when I write:

    <xsl:variable name="x" select="gal:func($airTraveler, $srnNP16 )"/>
    <xsl:value-of select="$x/preceding-sibling::ota:AirTraveler"/>

I don't obtain any preceding sibling.

Could you tell me why?

Many thanks

Bartolomeo

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.