Subject: RE: [xsl] Using DOM in XSL Documents (MSXML) From: "Chris Bayes" <Chris@xxxxxxxxxxx> Date: Thu, 14 Jun 2001 12:06:30 +0100 |
Ruairi, What you get passed is a XMLDOMNodeList so you need to do a nextNode on it to get a node that you can work with var aNode = item.nextNode(); Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml >-----Original Message----- >From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx >[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Ruairi >Sent: 14 June 2001 11:56 >To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx >Subject: [xsl] Using DOM in XSL Documents (MSXML) > > >Hi, > >I am using microsoft MSXML3.0 to illustrate to VB programmers what they can >do with XSL. I want to show them a comparison of XSL recursive templates >with XSL extensions. I want to show them how to do VB or JScript >stuff in a >xsl:script type element. I know this is normally not the done thing but >they need to know it, just in case... > > >However I have a small problem. I am trying to pass the content node into >the VBS function and it is not getting there. I am getting the following >error: "Object doesn't support the object or method item.selectSingleNode" > >Thanks.... > > >Regards, >-Ruairi > ><?xml version="1.0"?> ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >version="1.0" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > xmlns:vbs="http://www.abc.com/"> > > > <msxsl:script language="VBScript" implements-prefix="vbs"> > <![CDATA[ > running_total=0 > > function lineTotal(item) > > var price = item.selectSingleNode("tub").text > return price > End Function > ]]> ></msxsl:script> > ><xsl:output method="html"/> > > <xsl:template match="/"> > <body> > <h2 align="center" style="color:red">Scoops on Scooters</h2> > <h3>Customer: > <xsl:text> </xsl:text> > <xsl:value-of select="invoice/by/customer/name/first"/> > <xsl:text> </xsl:text> > <xsl:value-of select="invoice/by/customer/name/second"/> > </h3> > > <h3 align="right">Date: <xsl:value-of >select="invoice/@date"/></h3> > > <xsl:apply-templates select="//order"/> > </body> > </xsl:template> > > ><xsl:template match="order"> > <h3>The Order Summary:</h3> > <table border="1" cellspacing="0"><tr> > <th>Product</th> > <th>Unit Price</th> > <th>Quantity</th> > <th>Total</th></tr> > <xsl:apply-templates select="product"/> > > </table> > > <h3>Thank You, Phone and Scoop Again!! (800)-555-0000</h3> ></xsl:template> > ><xsl:template match="product"> > <tr> > <td width="200"><xsl:value-of select="@name"/></td> > <td align="center"> > <xsl:value-of select="price/@RRP"/></td> > <td align="center"> > <xsl:value-of select="sum(quantity//text())"/></td> > <td align="right" width="80"> > <xsl:value-of select="vbs:lineTotal(.)"/></td> > </tr> ></xsl:template> > ></xsl:stylesheet> > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Using DOM in XSL Documents (M, Ruairi | Thread | RE: [xsl] Using DOM in XSL Document, Hahn, Kimberly |
[xsl] Using DOM in XSL Documents (M, Ruairi | Date | RE: [xsl] calculate the maximum num, Rene de Vries |
Month |