473,574 Members | 18,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.FreeThre adedDomDocument .3.0");
xsl.async = false;
xsl.load("campa ignHtml.xsl");
var template = new ActiveXObject(" MSXML2.XSLTempl ate");
template.styles heet = xsl;
processor = template.create Processor();
processor.input = xmlDocument;
processor.addPa rameter(
"conferenceDocu ment"
,xmlConferenceD ocument.documen tElement.xml);
processor.trans form();
=============== =============== ==============

my xsl:

<?xml version="1.0"?>
<xsl:styleshe et
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
version="1.1">
<xsl:output method="html" indent="yes"/>

<xsl:param name="conferenc eDocument" select="."/>

<!-- the function does not return anything when a parameter is used
-->
<xsl:value-of select=
"msxsl:node-set($conference Document)/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="conferenc eDocument">
<ROWSET><ROW><C ONFERENCE_ID>1</CONFERENCE_ID>< CONFERENCE_CODE >SEC</CONFERENCE_CODE ><CONFERENCE_NA ME>Southeastern
Conference</CONFERENCE_NAME ></ROW><ROW><CONFE RENCE_ID>622</CONFERENCE_ID>< CONFERENCE_CODE >NONE</CONFERENCE_CODE ><CONFERENCE_NA ME>Unassigned</CONFERENCE_NAME ></ROW><ROW><CONFE RENCE_ID>111</CONFERENCE_ID>< CONFERENCE_CODE >ACC</CONFERENCE_CODE ><CONFERENCE_NA ME>Atlantic
Collegiate Conference</CONFERENCE_NAME ></ROW><ROW><CONFE RENCE_ID>324</CONFERENCE_ID>< CONFERENCE_CODE >B12</CONFERENCE_CODE ><CONFERENCE_NA ME>Big
XII</CONFERENCE_NAME ></ROW></ROWSET>
</xsl:variable>

<xsl:value-of select=
"msxsl:node-set($conference Document)/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 8609
ipg wrote:
processor.addPa rameter(
"conferenceDocu ment"
,xmlConferenceD ocument.documen tElement.xml);

Why don't you pass xmlConferenceDo cument.document Element 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********@yah oo.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 (xmlConferenceD ocument.documen tElement) 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_P LEASEtkachenko. 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
1744
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 ListNode for
1
2119
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 'List<T>::ListNode *' with Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast...
3
6032
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 xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
7
6155
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 Instance:DB2 Node:000 PID:2444(db2syscs.exe) TID:1696 Appid:*LOCAL.DB2.0115C3193403 data management sqldEndNoLogList Probe:1 Database:dbname
8
5895
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 by reference /// </param> /// <param name="source_id"> /// Default Value = 0
23
2392
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, there are lots of errors and warnings in compiling stage. I am really confused about this problem because I'm not even familiar with C++ and my code...
0
1123
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 received in the target side based on condition I explain my problem clearly. My source strucutre (with data) is like below....
1
2728
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 anything. I would love some help, here is the code: import socket import thread import time
17
16360
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
8188
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 accessing to the Generic class. private double mtrxgraphdata; private XMLdocument Matrixdata;
0
7738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8081
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8119
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6482
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3759
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3771
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1082
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.