Re: XSL and SELECT

Subject: Re: XSL and SELECT
From: "David Halsted" <halstedd@xxxxxxxxxx>
Date: Thu, 11 May 2000 17:30:33 -0400
> Neither in IE5 nor anywhere else are script functions callable directly by
> DHTML scripts.  See
>
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/xmlsdk/xslp0
> rho.htm for more information on the interactions (or lack of same) of
> transformation-time and run-time scripts.


No, but for some situations you can set JavaScript variables by inserting a
block of JavaScript code surrounded by a <script> tag pair.

<xsl:template match="row">
    <script language="JavaScript">
        var myObject = new Object;
        myObject.name= "<xsl:value-of select="@name"/>";
        myObject.feature1 = "<xsl:value-of select="@feature1" />";
    </script>
</xsl:template>

then that JavaScript spits out to the browser, which interprets it as, well,
JavaScript.  Functions in a block of JavaScript will then be able to get
myObject.  It's not the same thing as using the script function, but
depending on what you're trying to do it can be kind of handy for slurping
XML structures into JavaScript via XSLT.

Dave Halsed


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


Current Thread