Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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
 
Old April 30th, 2004, 06:07 PM
Registered User
 
Join Date: Apr 2004
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="/">





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
passing param to XSLT Dangerous Dave XSLT 0 April 30th, 2004 07:46 PM





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