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

Re: Portability function-available tips

Subject: Re: Portability function-available tips
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 9 Jan 2004 13:04:14 GMT
exslt node set
I wrote


    <msxsl:script language="JScript" implements-prefix="exsl">
       function node-set(r) {
    some javascript to return the thing cast to a node set
    which I'm sure you can do but don't have the doc to hand
    }
    </msxsl:script>
    

which isn't entirely true: you could define such a function but
you can't call it node-set as jscript functions can't have - in their
names, and if you call it anything else it doesn't really help.

So you can use the same trick in the other direction: use msxsl:node-set,
and that works natively on msxsl and for exslt processors define that
function using exsltf:function, the following has been tested (for a
change)

As Dimitre has said (and I said in my initial reply) if you are in a
situation where downloading a 3rd party extension to the processor is
OK, a better solution would be to use the msxml4 exslt implementation.

David




<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="set.xsl"?>
<xsl:stylesheet version="1.0"   
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
xmlns:exsltf="http://exslt.org/functions"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
extension-element-prefixes="exslt exsltf  msxsl"
>

<xsl:variable name="x">
<x>
 <a/>
 <b/>
 <c/>
</x>
</xsl:variable>

<exsltf:function name="msxsl:node-set">
<xsl:param name="x"/>
<exsltf:result select="exslt:node-set($x)"/>
</exsltf:function>

<xsl:template match="/">
[[[<xsl:value-of select="name(msxsl:node-set($x)/*/*[2])"/>]]]
</xsl:template>

</xsl:stylesheet>



-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.