[quoted text, click to view] <indyjones48@yahoo.com> wrote in message
news:1109348881.371416.191370@l41g2000cwc.googlegroups.com...
: Hi,
:
: I'm using msxml4 sp1 to transform some xml. My template looks like
: this:
:
: <xsl:call-template name="rowCounter">
: <xsl:with-param name="max_cols" select="2"/>
: <xsl:with-param name="N" select="1"/>
: </xsl:call-template>
:
: <xsl:template name="rowCounter">
: <xsl:param name="max_cols"/>
: <xsl:param name="N"/>
: <!-- If there are any entries in any section
: with a position number of $N then we produce a
: new table row -->
: param:<xsl:value-of select="$N"/>
: </xsl:template>
:
: The N value shows up empty in the resulting output. I've had this
: same trouble with with-param for the last 6 months -- just never
: REALLY needed to have it work, so I found ways to work around it.
:
: Now, though, I need it. Any ideas, why it's not working? Thx in
: advance.
I tested this with my msxml4 parser (SP 1) and I'm not seeing the
problem.
XML: (filename: data.xml)
<DATA/>
XSL: (filename: xform.xsl)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:fo="
http://www.w3.org/1999/XSL/Format"> <xsl:template match="/DATA">
<xsl:element name="OUTPUT">
<xsl:call-template name="rowCounter">
<xsl:with-param name="N" select="1"/>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template name="rowCounter">
<xsl:param name="max_cols"/>
<xsl:param name="N"/>
param: <xsl:value-of select="$N"/>
</xsl:template>
</xsl:stylesheet>
Test Code: (filename: test.vbs)
dim xml
dim xsl
Dim s
set xml = createobject("MSXML2.DOMDocument.4.0")
set xsl = createobject("MSXML2.DOMDocument.4.0")
xml.load("data.xml")
xsl.load("xform.xsl")
s = xml.transformnode(xsl)
createObject("Scripting.FileSystemObject").CreateTextFile( _
"output.xml").Write(s)
Output:
<?xml version="1.0"?><OUTPUT>
param: 1</OUTPUT>
Ralf