473,698 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

node-set working for msxml3 , msxml4 , saxon 8.1

Hi All,

ned help on the example below. It works fine for msxml3/4 but has
problems with saxon. Saxon complains "can not find matching function
..... "

My target is to write style sheets usable for msxml3 , msxml4 , saxon
..
Is there a general solution ?

Any help is highly welcome.

Rolf

<xsl:styleshe et version="2.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt">
<xsl:output method="xml" encoding="UTF-8" />

<xsl:variable name="gMyNodes" >
<MyNodes>
<a/>
<b/>
</MyNodes>
</xsl:variable>

<xsl:template match="/">
<xsl:variable name="vMyNodeSe t">
<xsl:choose>
<xsl:when test="function-available('msxs l:node-set')">
<xsl:copy-of select="msxsl:n ode-set($gMyNodes)"/>
</xsl:when>
<xsl:otherwis e>
<xsl:copy-of select="$gMyNod es"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNod eSet"/>
</xsl:template>

</xsl:stylesheet>
Jul 20 '05 #1
4 2121

<xsl:when test="function-available('msxs l:node-set')">
<xsl:copy-of select="msxsl:n ode-set($gMyNodes)"/>
</xsl:when>

saxon 6's node set function is in the saxon namespace
xmlns:saxon="ht tp://icl.com/saxon"
so you could add a when clause for that that uses saxon:node-set

Perhaps your example is just over simplified for posting but the above
code doesn't need node-set extension at all, if you are just copying to
the result you could use
<xsl:copy-of select="$gMyNod es"/>
with identical results.
David
Jul 20 '05 #2
David Carlisle <da****@nag.co. uk> wrote in message news:<yg******* ******@penguin. nag.co.uk>...
<xsl:when test="function-available('msxs l:node-set')">
<xsl:copy-of select="msxsl:n ode-set($gMyNodes)"/>
</xsl:when>

saxon 6's node set function is in the saxon namespace
xmlns:saxon="ht tp://icl.com/saxon"
so you could add a when clause for that that uses saxon:node-set

Perhaps your example is just over simplified for posting but the above
code doesn't need node-set extension at all, if you are just copying to
the result you could use
<xsl:copy-of select="$gMyNod es"/>
with identical results.
David
Dear David ,

Thank you for yopur feedback. Yes , I have oversimplified a bit. But
my real intention is to process the result of a temporary node set
further on by xslt.

I have tried your proposal, may be I made it wrong. It still complains
with saxon8.1.1. I have marked the error lines by comment. Please find
the modified xslt and the result for saxon below.
Do I really need the node-set function for saxon ?
I was thinking for xslt 2.0 I do not need a specific function to get
access to a temporary node set.

Thanks a lot

Rolf

<xsl:styleshe et version="2.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
xmlns:saxon="ht tp://icl.com/saxon"

<xsl:output method="xml" encoding="UTF-8" />

<xsl:variable name="gMyNodes" >
<MyNodes>
<a/>
<b/>
</MyNodes>
</xsl:variable>

<xsl:template match="/">
<NodeTest>
<xsl:variable name="vMyNodeSe t">
<xsl:choose>
<xsl:when test="function-available('msxs l:node-set')">
<msxml>
<xsl:copy-of select="msxsl:n ode-set($gMyNodes)"/><!-- saxon
error -->
</msxml>
</xsl:when>
<xsl:when test="function-available('saxo n:node-set')">
<saxon>
<xsl:copy-of select="saxon:n ode-set($gMyNodes)"/><!-- saxon
error -->
</saxon>
</xsl:when>
<xsl:otherwis e>
<ERROR>No node set function available, or missing
processor</ERROR>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNod eSet"/>
</NodeTest>
</xsl:template>

</xsl:stylesheet>
Jul 20 '05 #3


I have tried your proposal, may be I made it wrong. It still complains
with saxon8.1.1

That's why I said saxon 6. I just noticed that the subject line does
explictly say saxon 8 but I missed that on first reading:-)
To be honest you probably shouldn't be using saxon 8.1: saxon 8 is
tracking the XSLT 2 drafts so is something of a moving target, It's
pretty stable but I think it's best to keep up to date (8.4 is current)
lest you find you are relying on some feature that got changed in the
final spec.

There is an extension namespace in saxon 8 (check the docs) but
it's not the same one as for saxon6. But in that case you are correct
that it shouldn't be needed at all. as you can use XSLT2 features (even
though presumably your stylesheet is flagged as version="1.0" so you
will be in backward compatibility mode.

David
Jul 20 '05 #4


I tried your stylesheet (running on itself) with saxon 8.4, it falls
foul of compile time checking. XSLt2 allows the system to report
certain errors even in code that will never be executed.
(Don't blame me:-)
this severely compromises the use of function-available in an xsl:choose
as a guard for conditional code as the compiler barfs on the branches
that will not be executed. A compile time xsl:use-when facility has been
added to try to restore some usability, I have added this to your code
below and Ithink it should work now in msxml saxon6 and saxon8 (although
I only ran it with saxon 8.4)

David

<xsl:styleshe et version="2.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
xmlns:saxon="ht tp://icl.com/saxon"

<xsl:output method="xml" encoding="UTF-8" />

<xsl:variable name="gMyNodes" >
<MyNodes>
<a/>
<b/>
</MyNodes>
</xsl:variable>

<xsl:template match="/">
<NodeTest>
<xsl:variable name="vMyNodeSe t">
<xsl:choose>
<xsl:when test="function-available('msxs l:node-set')">
<msxml>
<xsl:copy-of use-when="function-available('msxs l:node-set')" select="msxsl:n ode-set($gMyNodes)"/><!-- saxon
error -->
</msxml>
</xsl:when>
<xsl:when test="function-available('saxo n:node-set')">
<saxon>
<xsl:copy-of use-when="function-available('saxo n:node-set')" select="saxon:n ode-set($gMyNodes)"/><!-- saxon
error -->
</saxon>
</xsl:when>
<xsl:when test="system-property('xsl:v ersion')='2.0'" >
<saxon8>
<xsl:sequence select="$gMyNod es"/>
</saxon8>
</xsl:when>
<xsl:otherwis e>
<ERROR>No node set function available, or missing
processor</ERROR>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNod eSet"/>
</NodeTest>
</xsl:template>

</xsl:stylesheet>
Jul 20 '05 #5

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

Similar topics

8
3074
by: J Peterman | last post by:
Im having a nightmare trying to understand these nodes and linked lists. I've posted my code for my node.h, node.cpp, linkedlist.h and linkedlist.cpp files in separates replies. Can someone explain to me how I create a list and traverse it? In particular, how do I make use of the node.h method GetNext()? I don;t know what to do with it.
6
9252
by: Chuck | last post by:
What's the difference between using "catalog node" and catalog admin node"? -- Chuck Remove "_nospam" to reply by email
3
3249
by: stabbert | last post by:
We are running DB2 UDB 8.1.6 in a partitioned environment where we have 8 physical nodes. We have a process that remotely connects to each individual node and loads some data. By setting the DB2NODE variable to a different value then the coordinator node is the only way I am aware for a remote application to do this so I am making the assumption that is how this application connects. What I am more interested in is that after logging...
5
3304
by: Jeroen Ceuppens | last post by:
I need to put a new node at the end of the tree, that end is not te lowest in de list but the deepest (the one with the most + before it) Node A Node 1 Node 2 Node 3 Node 4: Deepest Node B: not this one
3
6059
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an hierarchical view of Parent Nodes and projects where in a projectnode can be added to any ParentNode and hence we may have a project node added to 100 Parent nodes. In this one, I have an operation of Renaming a Project Node. So whenever I am doing the...
5
6665
by: poldoj | last post by:
Hi all, I have a treenode control and I would like to add a node in a certain level as child. For example I know that with this code I can add a level one node plus a level two node: ------------------- Dim node As TreeNode node = TreeView1.Nodes.Add("Level one node") node.Nodes.Add("Level two node") -------------------
8
1992
by: Dylan Parry | last post by:
Hi folks, I have an XML node called "myNode" and it contains: "This is some text" Now I can use the myNode.nodeValue property to get the string of text above. But say myNode contains: "This is <em>some text</em>"
6
2012
by: Derek Hart | last post by:
I bring in an xml file into vb.net by using xmlDoc.LoadXml(XMLString) - I run xpath statements against the xml file to grab data from it, so I use, as an example, //Vehicles/Vehicles/@make to get the make of the car. But then I pass a specific node from xmlDoc into another function, not the whole xmlDoc, just a node from it. And if I run an xpath against it, I have to use .// (has a period at the beginning) so it does not grab info from...
9
18682
by: Moses | last post by:
Hi All, How to check weather a node has sibling? Is there any function like " hasChildNodes() " Thanks in Advance Moses
3
447
by: Kane | last post by:
When you create node 1 you allocate memory and link it Again when you create node 2 you would allocate memory for that node in a different section of the code. Is there more efficient way where I can allocate memory once and use it to create new node in list. -Thanks -Kane
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9161
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6522
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.