my html:
var xsl = new ActiveXObject("MSXML2.FreeThreadedDomDocument.3.0");
xsl.async = false;
xsl.load("campaignHtml.xsl");
var template = new ActiveXObject("MSXML2.XSLTemplate");
template.stylesheet = xsl;
processor = template.createProcessor();
processor.input = xmlDocument;
processor.addParameter(
"conferenceDocument"
,xmlConferenceDocument.documentElement.xml);
processor.transform();
============================================
my xsl:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
version="1.1">
<xsl:output method="html" indent="yes"/>
<xsl:param name="conferenceDocument" select="."/>
<!-- the function does not return anything when a parameter is used
-->
<xsl:value-of select=
"msxsl:node-set($conferenceDocument)/ROWSET/ROW/CONFERENCE_CODE" />
...
==============================================
<!-- However when I print the parameter to screen and hardcode the
screen output into a variable tag, the function works fine. -->
<xsl:variable name="conferenceDocument">
<ROWSET><ROW><CONFERENCE_ID>1</CONFERENCE_ID><CONFERENCE_CODE>SEC</CONFERENCE_CODE><CONFERENCE_NAME>Southeastern
Conference</CONFERENCE_NAME></ROW><ROW><CONFERENCE_ID>622</CONFERENCE_ID><CONFERENCE_CODE>NONE</CONFERENCE_CODE><CONFERENCE_NAME>Unassigned</CONFERENCE_NAME></ROW><ROW><CONFERENCE_ID>111</CONFERENCE_ID><CONFERENCE_CODE>ACC</CONFERENCE_CODE><CONFERENCE_NAME>Atlantic
Collegiate Conference</CONFERENCE_NAME></ROW><ROW><CONFERENCE_ID>324</CONFERENCE_ID><CONFERENCE_CODE>B12</CONFERENCE_CODE><CONFERENCE_NAME>Big
XII</CONFERENCE_NAME></ROW></ROWSET>
</xsl:variable>
<xsl:value-of select=
"msxsl:node-set($conferenceDocument)/ROWSET/ROW/CONFERENCE_CODE" />
==================================================
Can someone please explain why. Why is the parameter not being
evaluated like the text written between the var tags above. Please
enlighten me. I have spent 2 days on this.
Thanks,
Patrick
> I am running into issues passing a parameter (that is a XML string)
> into a stylesheet and using msxsl:node-set to parse the string.
Why do you think msxsl:node-set function parses a string????
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
1. The xxx:node-set() extension function does not parse a string. A string
is not an RTF (Result Tree Fragment). An RTF is a tree of nodes.
2. You should pass as parameter the node-set itself, which you have already
parsed (xmlConferenceDocument.documentElement) and not its string
representation. Then you do not need xxx:node-set() at all, the parameter is
a node-set -- not an RTF.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"ipg" <patrick...@yahoo.com> wrote in message
news:6c03162c.03081...@posting.google.com...
>Two things:
>
>1. The xxx:node-set() extension function does not parse a string. A string
>is not an RTF (Result Tree Fragment). An RTF is a tree of nodes.
>
>2. You should pass as parameter the node-set itself, which you have already
>parsed (xmlConferenceDocument.documentElement) and not its string
>representation. Then you do not need xxx:node-set() at all, the parameter is
>a node-set -- not an RTF.
What's the difference between a "tree of nodes", then, and a
"node-set"?
> What's the difference between a "tree of nodes", then, and a
> "node-set"?
The difference between result-tree fragment and nodeset:
http://www.w3.org/TR/xslt.html#section-Result-Tree-Fragments
It's only XSLT 1.0 related data type, XSLT 1.1 and 2.0 managed to get rid of it.
>Mark Johnson wrote:
>> What's the difference between a "tree of nodes", then, and a
>> "node-set"?
>The difference between result-tree fragment and nodeset:
>http://www.w3.org/TR/xslt.html#section-Result-Tree-Fragments
Doesn't really say what it is, though. It mentions vague - extension
functions - from a small section further on. But I assume a result
fragment is a node-set representation of part of the result of the
xslt transform. And a node-set, generally, is the subset of the XML as
returned by an XPath expr.
>It's only XSLT 1.0 related data type, XSLT 1.1 and 2.0 managed to get rid of it.
So there's only - node-set. I've seen various articles of yours, say
at MSDN. You've been referring to a proposed 2.0. Is it available? Is
it part of an msxml 4? 5?
> Doesn't really say what it is, though. It mentions vague - extension
> functions - from a small section further on. But I assume a result
> fragment is a node-set representation of part of the result of the
> xslt transform. And a node-set, generally, is the subset of the XML as
> returned by an XPath expr.
Well, that's not quite clean explanation too. RTF is actually just a temporary
tree. The only way to produce it is using a variable. Variable is bound to RTF
if it has any content (hence doesn't have select attribute). The same goes for
xsl:param and xsl:with-param actually:
<xsl:variable name="rtf">
<a>foo</a>
</xsl:variable>
It's called result-tree fragment, becuase all you can do with it is to copy it
out (usually to the result tree) either by xsl:value-of or xsl:copy-of.
> So there's only - node-set. I've seen various articles of yours, say
> at MSDN. You've been referring to a proposed 2.0. Is it available? Is
> it part of an msxml 4? 5?
It's still working draft and there is no MS implementation yet. I'm aware of
the only experimental XSLT2.0 impl - Saxon 7.X.