Subject: RE: [xsl] XLST Processors that support JavaScript From: Eric Promislow <ericp@xxxxxxxxxxxxxxx> Date: Wed, 4 Sep 2002 10:25:12 -0700 |
Kirk, the other issue here is how to access the MS XPath extensions derfined in MSXML 4.0 (defined in the URI mk:@MSITStore:C:\Program%20Files\MSXML%204.0\doc\xmlsdk.chm::/htm/xpath_functions_6igj.htm -- this is the MSXML 4.0 SDK Docs -- Core Services/XPath Reference/ XPath Functions/MS XPath Extension Functions). The function I see come up repeatedly is 'ms:format-date', and it's significantly easier to use than System.DateTime. I can't figure out how to access this namespace without writing a .net wrapper class around MSXML 4. Is there a way of doing this inside System.Xml.Xsl XSLT? - Eric > Date: Tue, 3 Sep 2002 11:34:34 -0400 > From: "Kirk Allen Evans" <kaevans@xxxxxxxxxxxxx> > Subject: RE: [xsl] XLST Processors that support JavaScript > > - -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Ziv Friedman > Sent: Tuesday, September 03, 2002 10:21 AM > To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' > Subject: RE: [xsl] XLST Processors that support JavaScript > > > So why is it that when I use "urn:schemas-microsoft-com:xslt" in the > > stylesheet tag I get the following error: "The scripting language > > 'vbscript' is not supported"? > > That's not quite the same as JavaScript, now is it? VBScript is not > supported in .NET, but VB, C#, JScript, and JavaScript are [1]. I > imagine that, if you installed J#, that it would be supported as well. > Here is a JavaScript example that works: > > <?xml version="1.0" encoding="UTF-8" ?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > xmlns:tns="urn:thisnamespace:tns" > exclude-result-prefixes="tns msxsl"> > <msxsl:script language="JavaScript" implements-prefix="tns"> > > function GetString() > { > return('foo'); > } > </msxsl:script> > > <xsl:template match="/"> > <xsl:for-each select="root/child"> > <xsl:value-of select="tns:GetString()"/> > </xsl:for-each> > </xsl:template> > </xsl:stylesheet> > > Change the language attribute of the msxsl:script element to "VB" > instead, and now this example works (note, though, that > VBScript-specific functions and syntax might not be supported in VB.NET > [1]): > > <msxsl:script language="vb" implements-prefix="tns"> > function GetString() > GetString = "foo" > end function > </msxsl:script> > > The really cool part about .NET is that you can also use inline C# as > well as JavaScript or VB.NET. Although, I would use an extension object > with the XsltArgumentList class instead, but this example shows that it > is possible: > > <msxsl:script language="C#" implements-prefix="tns"> > string GetString() > { > return("foo"); > } > </msxsl:script> > > > [1] > ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconvisualbasiclanguagechanges > .htm > > > Kirk Allen Evans > http://www.xmlandasp.net > Author, "XML And ASP.NET", New Riders Publishing > http://www.amazon.com/exec/obidos/ASIN/073571200X XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XLST Processors that supp, Kirk Allen Evans | Thread | RE: [xsl] XLST Processors that supp, Kirk Allen Evans |
Re: [xsl] j2sdk1.4.0 xslt and setPa, Joerg Heinicke | Date | Re: [xsl] still getting problem, Joerg Heinicke |
Month |