Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:01:23+00:00 2026-06-10T12:01:23+00:00

Pretty basic developer here. I currently use mappath to transform my XSL and XML

  • 0

Pretty basic developer here. I currently use mappath to transform my XSL and XML on the server side. This works famously but only use this BC it was the example used on W3C school site. I am trying to expand some of the capabilities of my page by passing parameters around via the URL string. As you may already know I cannot pass a URL parameter with the mappath method. I cant for the life of me figure out how to do this any other way. Google did not offer and clear examples nor did my wrox book.

Can someone please enlighten me on how to accomplish passing parameters into the XSLT?

I guess I either need to use a new method for serverside transformations or I need to understand a new way to pass parameters.

Thanks all your help in the past has made a huge difference in my project!

KG

My Current Code

<html><title>Report</title>
<head>
</head>
<%
'Load XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("/XML/XMLData/View.xml"))

'Load XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("Data.xsl"))
'Transform file
Response.Write(xml.transformNode(xsl))
%>
</html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:01:25+00:00Added an answer on June 10, 2026 at 12:01 pm

    Just to be pedantic for a moment, it is not map path that is doing the transform here. All Server.MapPath does is convert a relative or virtual path (“/XML/XMLData/View.xml” in your case) to a physical directory on the server, which can then be loaded by the XML processor. In your case you are using ASP, so the processor is MSXML.

    Fortunately, you this does support the passing of parameters, although you do have to do a little bit of extra work. Try this code sample instead

    <html><title>Report</title> 
    <head> 
    </head> 
    <% 
    ' Load XML
    set xmldoc = Server.CreateObject("Msxml2.DOMDocument")
    xmldoc.async = false
    xmldoc.load(Server.MapPath("/XML/XMLData/View.xml"))
    
    ' Load XSLT (as XML)
    Set xsldoc = Server.CreateObject("Msxml2.FreeThreadedDOMDocument")
    xsldoc.async = false
    xsldoc.load(Server.MapPath("Data.xslt"))
    
    ' Set up stylesheet
    set xslt = Server.CreateObject("Msxml2.XSLTemplate")
    xslt.stylesheet = xsldoc
    
    ' Create a processor to do the transform
    Set xslproc = xslt.createProcessor()
    xslproc.input = xmldoc
    xslproc.addParameter "myParam", "Hello World"
    xslproc.transform()
    
    Response.Write xslproc.output
    %> 
    </html> 
    

    Within the XSLT itself, you will obviously need to specify the parameter. This is done by using the xsl:param element. This needs to go within the xsl:stylesheet element, near the top, and outside of any xsl:template elements you have

    <xsl:param name="myParam" select="'Good Morning'" />
    

    Note that the select attribute in this case specifies a default value should the parameter not be set by the calling code.

    I notice you have tagged the question asp.net too, in which case you might want to read up about XSLTCompliled transform, which is the class you use when doing XSLT transformations in .Net.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty basic stuff here, trying to pull the number 14.5 out of this string
This is a pretty basic question. I'm trying to use SciPy/NumPy to perform fft
this is a pretty basic question but I can't seem to get it right.
This might be a pretty basic question, or peculiar to my set up (hopefully
This is a pretty basic question. I am wondering if the Unreal Development Kit
I guess this is going to sound like a pretty basic question to any
this is a pretty basic question but I'm not entirely clear how to do
Pretty basic question here. How come I get a 404 error when I try
I have a pretty basic doubt. Often, I have to write apps which use
Pretty basic question ... I can not find the compatibility table (was looking at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.