Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 30th, 2004, 07:46 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing param to XSLT

In the following code sample, I am trying to pass a value into my XSLT, but I get the error:

Microsoft VBScript runtime (0x800A01A8)
Object required: '[object]'

The error is occurring on the line between the two commented lines saying '*** ERROR ***


dim objXMLDoc
dim objXSLDoc
dim strXMLDoc
dim strXSLDoc
dim strResults
dim Cnt
dim Location
dim Path
dim strHTTP
dim String1
dim strLeft
dim strRight
dim XSLParam
dim ItemToView

const PROG_ID = "Microsoft.XMLDOM"
'Get the XML file name from the Request object
strXMLDoc = server.mappath(request("XML"))
'Get the XSL file name from the Request object
strXSLDoc = server.mappath("./Browse.xsl")
Path = request("Path")
ItemToView = request("Item")
strHTTP = chr(34) & "http://" & chr(34)

if err.number = 0 then
    'Parse the XML Document
    set objXMLDoc = server.CreateObject(PROG_ID)
    objXMLDoc.async = false
    objXMLDoc.load(strXMLDoc)
    if objXMLDoc.parseError.errorCode = 0 then
        'Parse the XSL style sheet
        set objXSLDoc = server.CreateObject(PROG_ID)
        objXSLDoc.async = false
        objXSLDoc.load(strXSLDoc)
        set XSLParam = objXSLDoc.selectSingleNode("//xsl:param[@name='ItemToView']")
'*** ERROR ***
        XSLParam.childnodes(0).nodevalue = ItemToView
'*** ERROR ***
        if objXSLDoc.parseError.errorCode = 0 then
            'If no errors, transform the XML
            'into HTML using the XSL style sheet
        strResults = objXMLDoc.transformNode(objXSLDoc)
        else
        strResults = "The following error " & _
            "occurred while " & _
            "processing the XSL " & _
            "stylesheet: <br>" &_
            objXSLDoc.parseError.errorCode & _
            ", " & _
            objXSLDoc.parseError.reason
        end if
    else




Here are the first few lines of my XSLT

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:did="urn:mpeg:mpeg21:2002:01-DIDL-NS" >
<xsl:param name="ItemToView" select="'1'" />

<xsl:template match="/">
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Node as a Param from javascript to XSL pnviv XSLT 4 November 15th, 2007 05:57 AM
passing a page into a web service as a byref param jonny75904 ASP.NET 1.0 and 1.1 Professional 0 August 15th, 2006 04:08 PM
passing param to Crystal hide4motion C# 0 October 23rd, 2005 03:32 PM
lost slashes when passing in param bleitner Javascript 5 August 20th, 2004 10:01 AM



All times are GMT -4. The time now is 09:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.