This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: passing parameters to a XSLT from HTML


(apologies for the double-post if it happens.. smtp problems)

Rafael,

Try this piece of javascript (using MSXML3)


  var xml = new ActiveXObject("MSXML2.DOMDocument.3.0")
  xml.async = false
  xml.load('xmlPath')

  var xsl = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0")
  xsl.async = false
  xsl.load('xslPath')

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

  processor.input = xml
  processor.addParameter("param1",'some value')
  processor.addParameter("param2",'some value')
  //...and so on
  processor.transform()

  document.write(processor.output)

and include the following in you stylesheet as top-level elements:

<xsl:param name="param1"/>
<xsl:param name="param2"/>

This should be a start for you.

cheers

andrew




-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of rafael
vazquez
Sent: 09 January 2002 08:51
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] passing parameters to a XSLT from HTML


Hi All! I´d thank a fast response for my question, because I´m a beginner in
XSLT.

I have a HTML page that contains an option list and I want to pass its value
to a XSLT located in other frame, to use the mentioned value in the
stylesheet.
I´m very lost about this question. Can anyone help me?

Thanks in advance, friends!

_________________________________________________________________
MSN Photos es la manera más sencilla de compartir e imprimir sus fotos:
http://photos.latam.msn.com/Support/WorldWide.aspx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/2002


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]