This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: passing parameters with IE
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] passing parameters with IE
- From: Rene de Vries <RdVries at PCL-HaGe dot nl>
- Date: Mon, 2 Jul 2001 09:35:37 +0200
- Cc: "'ivan dot sanmartin at ua dot es'" <ivan dot sanmartin at ua dot es>
- Organization: PCL HaGé b.v.
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Ivan,
I don't think it can be done your way, but you can use a JavaScript in my
HTML to pass parameters. I use a compiled XSL-object, because I use the
same XSL several times.
Note that I use MXSML4 with IE5.5!!!
<html>
<body>
<script type="text/javascript">
// Load your XSL
var objXSLT = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
objXSLT.async = false
objXSLT.load("YourStylesheet.xsl")
// create a compiled XSL-object
var objCompiled = new ActiveXObject("MSXML2.XSLTemplate")
objCompiled.stylesheet = objXSLT.documentElement
// create XSL-processor
var objXSLProc = objCompiled.createProcessor()
// Load your XML
var objXML = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
objXML.async = false
objXML.load("YourXML.xml")
// input for XSL-processor
objXSLProc.input = objXML
objXSLProc.addParameter("NameOfYourParameter1", "ValueOfYourParameter1")
objXSLProc.addParameter("NameOfYourParameter2", "ValueOfYourParameter2")
// etc.
// transform
objXSLProc.transform()
// display
document.write(objXSLProc.output)
</script>
</body>
</html>
Greetings Rene
{ @ @ }
^
\__/
"You don't need eyes to see, you need vision!"
-----Oorspronkelijk bericht-----
Van: Ivan Nicolas San Martin Calera [SMTP:ivan.sanmartin@ua.es]
Verzonden: vrijdag 29 juni 2001 16:23
Aan: xsl-list@lists.mulberrytech.com
Onderwerp: [xsl] passing parameters with IE
Hi,
I have one doubt, I want pass parameters to xslt (I know do that
with command line processor) but the transformation is directly done
with IE.
For example, I have this stylesheet (exampleXSL.xsl):
<xsl:param name="num">1</xsl:param>
<xsl:template match="/">
parameter value: <xsl:value-of select="$num"/>
</xsl:template>
the XML file (exampleXML.xml):
<?xml-stylesheet type="text/xsl" href="exampleXSL.xsl"?>
<doc>
<p>one</p>
<p>two</p>
<p>3</p>
<p>4</p>
</doc>
and I want pass values for "num" from URL like
"exampleXML.xml?num=3" using IE. Is this possible?
Thanks!!
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list