[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: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 21 Jan 2003 21:39:24 -0800 (PST)
xsl setattribute
> > What I think is the best solution of your problem is to set the 
> > value of the "select" attribute of a global xsl:param to the 
> > *string* XPath
> > expression. You can do this using the selectSingleNode() and then
> > setAttribute() methods. Then perform the transformation.
> 
> I can't do that, I'm not using MSXML.....! I'm using LibXSLT with 
> > AxKit on Mac OS X.
> 

This is not MSXML-specific. I think the setAttribute() method is a
standard W3C DOM method.

For example, here's how the same technique is implemented in the XPath
Visualizer for Mozilla:

 objStylesheetParam = style.evaluate("/*/*[name()='xsl:param']
                                              [@name='selectedNodes']",
	                             style, 
                                     null, 
                                     XPathResult.ANY_TYPE, 
                                     null)
                                         .iterateNext();

and further down in the code:

 objStylesheetParam.setAttribute("select", txtQuery);

 var txtResult = source.transformNode(style);


It should be possible to implement this technique for any XSLT
processor, given the specific API it uses. What is necessary is:

1. to be able to invoke a method that evaluates an XPath expression to
return the "xsl:param" element, 

2. then use the setAttribute() method on this element to dynamically
hardwire its value.

3. Only then invoke the xslt transformation.


Anyway, in our discussion about a persistent node id Mike Kay came with
a very good proposal. Using it one will not need any xx:evaluate()
extension function:

http://www.sonicsoftware.com/cgi-bin/dnewsweb/public/dnewsweb?cmd=article&group=xsl-list&item=14175&utag=




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 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.