[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: passing a value from HtML to XSL

Subject: Re: passing a value from HtML to XSL
From: "Agnes kielen" <a.kielen@xxxxxxx>
Date: Mon, 18 Feb 2002 18:46:37 +0100
passing html to xsl
Hello Kit,

This is a copy of a post from Andrew Welch, which was very helpful to me.

----------------------------------------------------------------
to pass in a parameter from a javascript function:

(this is assuming you have msxml3 installed)

function whatever(){

  var xml = new ActiveXObject("MSXML2.DomDocument.3.0");
  xml.async = false;
  xml.load("yourXmlFile.xml");

  var xsl = new ActiveXObject("MSXML2.FreeThreadedDomDocument.3.0");
  xsl.async = false;
  xsl.load("yourXslFile.xsl");

  var template = new ActiveXObject("MSXML2.XSLTemplate")
  template.stylesheet = xsl
  processor = template.createProcessor()

  processor.input = xml
  processor.addParameter("param1", "param1value")
  processor.addParameter("param2", "someOtherValue")
  //and so on

  processor.transform()

  document.open()
  document.write(processor.output)
  document.close()
}

Make sure you include the following param declarations as top-level elements
(basically below the namespace) of your stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="param1"/>
<xsl:param name="param2"/>

You can then access the params using $param1 and so on...

Remember, once a variable is assigned a value in a stylesheet in cannot be
changed - its more like a constant.

--------------------------------------------------------------

Cheers Agnes




----- Original Message -----
From: "林 子芯" <minikittygo@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, February 18, 2002 3:40 PM
Subject:  passing a value from HtML to XSL


>
>
> Hi, can somebody tell me how is a value in a html pass directly to an xsl?
> i have a html form that allows end user to type in the keywords, once type
> the value is pass into the xsl file. is that feasible, if not is there is
> any other ways to get round it?
>
> Thanks for your time
> Regards
> Kit
>
> _________________________________________________________________
> 在 http://explorer.msn.com.hk/intl.asp 免費下載 MSN Explorer
>
>
>  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.