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

RE: top level params and xsl:attribute magic?

Subject: RE: top level params and xsl:attribute magic?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Sun, 19 Jan 2003 20:16:17 -0000
RE:  top level params and xsl:attribute magic?
> I'm beginning to think that XSLT is a bit like magic. If you 
> think the 
> right way, and use the right magic incantation, it works like 
> a charm. If you don't, no cigar.

I would have said that was a characteristic of computer programming in
general.
> 
> I have this top-level param to grab a param from http:
>    <xsl:param name="StartPointStr">.</xsl:param>
> 
> The param StartPointStr is an Xpath string. Next I have this (which 
> works) (1)
>    <xsl:param name="StartNode" select="dyn:evaluate($StartPointStr)"/>
> 
> Compare to this (which doesn't work): (2)
>    <xsl:param name="StartNode">
>          <xsl:attribute name="select">
>            <xsl:value-of select="dyn:evaluate($StartPointStr)"/>
>          </xsl:attribute>
>    </xsl:param>
> 
> (1) works and (2) doesn't work. With two, I get nothing, empty node 
> set. They should be equivalent!

They are completely different. (1) passes the result of evaluating the
expression held in $StartPointStr. (2) attempts to pass a result tree
fragment containing an attribute node whose name is "select" and whose
value is the result of evaluating the expression held in $StartPointStr.
XSLT doesn't allow creation of attribute nodes except when they are
attached to an element, so this should throw an error.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.