473,320 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem using msxsl:node-set with xsl:param

ipg
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. Can
someone please explain why.

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
Jul 20 '05 #1
5 8567
ipg wrote:
processor.addParameter(
"conferenceDocument"
,xmlConferenceDocument.documentElement.xml);

Why don't you pass xmlConferenceDocument.documentElement as is? Isn't it weird
to serialize document to string just to pass it to XSLT and then parse it back
again?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #2
"Dimitre Novatchev" <dn********@yahoo.com> wrote:
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"?
Jul 20 '05 #3
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#secti...Tree-Fragments
It's only XSLT 1.0 related data type, XSLT 1.1 and 2.0 managed to get rid of it.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #4
Oleg Tkachenko <oleg@NO_SPAM_PLEASEtkachenko.com> wrote:
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#secti...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?

Jul 20 '05 #5
Mark Johnson wrote:
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.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: darkstorm | last post by:
Hi, Please have a look at this code when compiling it is giving error: error C2440: '=' : cannot convert from 'ListNode *' to 'List<T>::ListNode *' with when I added List<T>:: before...
1
by: darkstorm | last post by:
Please check this program...When I compiles it in VC.net, it gives the following error: =============== Common\Lib\PList.h(115): error C2440: '=' : cannot convert from 'ListNode *' to...
3
by: John R. | last post by:
I have an application written in C# and i am using MS XML DOM! I have a document with the following structure (only the <DicEntry> - Elements are important): <NewDataSet...
7
by: Tim.D | last post by:
Folks, I did run into a small problem afterall. Running my first SP I am seeing a number of errors in the windows 2k server event viewer. Following is a paste: -- 2004-03-03-15.06.49.967001 ...
8
by: Michael.Suarez | last post by:
So I wrote a DLL in 2.0. An example of one of the funtions is: /// <summary> /// db_task..file_master_list /// </summary> /// <param name="panConnection"> /// Pass the PanApp.Connection object...
23
by: Babak | last post by:
Hi Everyone, I've written a standard C code for a simple finite element analysis in MSVC++ . When I save the file as a cpp file, it compiles and runs perfectly, but when I save it as a c file,...
0
by: jegathees | last post by:
Hi Friends, I am working in SAP XI Platform. In this, we use XSLT Mapping. I am facing one problem to print in field 'RecordID' starts from 1,2,3 in the target structure for those records...
1
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do...
17
by: AceKnocks | last post by:
I have been given this interface, interface BinarySearchTree { public void insert(Integer data); public int size(); public int height(); public boolean contains(Integer target); }
1
by: niharnayak2003 | last post by:
Hi All, I am facing the problem in Typecast inside the Generic class. I need a function which will take two param 1:-Xpath 2:- XMLDOC and return me what i will need. here is the code for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.