General discussion

Locked

Passing parameters to XSL templates

By Mark W. Kaelin Editor ·
Tell us what you think about our tip on passing parameters to XSL templates programmatically.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

any example using DOM?

by pzhang In reply to Passing parameters to XSL ...

very interesting topic! I am also wondering if there is any similar sample code for Microsoft developers.

Thanks a lot for your help in advanced.

Collapse -

MSXML 3.0 Example

by danieljaysmith In reply to any example using DOM?

Hi

This is taken from the MSXML 3.0 help file.
-------------------------
Example VB code:

Dim xslt As New Msxml2.XSLTemplate
Dim xslDoc As New Msxml2.FreeThreadedDOMDocument
Dim xmlDoc As New Msxml2.DOMDocument
Dim xslProc As IXSLProcessor
xslDoc.async = False
xslDoc.Load "sample.xsl"
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "books.xml"
Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
xslProc.addParameter "param1", "Hello"
xslProc.Transform
MsgBox xslProc.outputSample.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:param name="param1"/>
<xsl:template match="/">
The parameter value was: <xsl:value-ofselect="$param1"/>
</xsl:template>
</xsl:stylesheet>

Collapse -

Can of Worms?

by benhereb4 In reply to MSXML 3.0 Example

What a can of worms? Gonna cover it ALL?

I REALLY wish you'd STOP sending me articles, where half the way through, I find out things like...

We'll use the Apache Software Foundation's Xalan product

Java is useless, much slower, and SIMPLY beyond my re-consideration forever! They blew it by being so SLOW and RESTRICTIVE...

You CAN KEEP -- Java!

4 FILES to accomplish that???

I'd sooner write a good 'html' file in less of a FOURTH of the time spent on what you suggest!

Just utterly ridiculous IMHO

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums