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

Re: Converting a string to node test

Subject: Re: Converting a string to node test
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sat, 21 Apr 2001 21:34:53 +0100
context.nextnode.selectnodes xsl
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


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.