472,354 Members | 2,231 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 8484
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.