[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Converting a string to node test
Hi, > Does Microsoft have an extension function like saxon:evaluate() ? Not a built-in one, no. However, you can define one of your own using msxsl:script. The following one just interprets XPaths and is basically the one posted by Andrew Kimball in January: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dyn="http://exslt.org/dynamic" xmlns:msxsl="urn:schemas-microsoft-com:xslt" extension-element-prefixes="dyn msxsl"> <msxsl:script implements-prefix="dyn" language="jscript"> function evaluate(context, expression) { return context.nextNode().selectNodes(expression); } </msxsl:script> ... </xsl:stylesheet> You could call it with: dyn:evaluate(., concat('@', $y)) to get the attribute named the same as the string held in $y on the context node. [I've used the EXSLT namespace here, but you should make up your own unless you submit the function to the EXSLT site at http://www.exslt.org/.] I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|