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

Re: passing parameters to xsl stylesheets

Subject: Re: passing parameters to xsl stylesheets
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 20 May 2007 18:07:55 +0200
Re:  passing parameters to xsl stylesheets
Youness HAFFANE wrote:
Thanks a lot Xmlize,I tried it an it works very fine.
I've also tried this and it works too:

 <xsl:template match="/">
      <xsl:value-of select="note[to=$toto]/to" />

-----Original Message-----
From: mozer [mailto:xmlizer@xxxxxxxxx]

<xsl:template match="/note"> <html>
<xsl:value-of select="*[local-name()=$toto]" />

FYI: Note that there's a large difference between the two.

1. The first one (yours, with note[to = $toto]/to) selects all 'to' nodes where the contents is equal to the value of $toto:
$toto = 'Tove'
will select: <to>Tove</to>

2. The second one (from mozer, with *[local-name()=$toto]) will select all children nodes where the name of the node is equal to the value of $toto:
$toto = 'from'
will select: <from>Jani</from>

and, of course, you select only the 'to' nodes with a parent 'note', whereas mozer selects all children from node 'note' that match the name in $toto.

-- Abel Braaksma

Current Thread


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.
First Name
Last Name
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.