473,322 Members | 1,806 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,322 software developers and data experts.

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:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn: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="vMyNodeSet">
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:copy-of select="msxsl:node-set($gMyNodes)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$gMyNodes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNodeSet"/>
</xsl:template>

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

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

saxon 6's node set function is in the saxon namespace
xmlns:saxon="http://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="$gMyNodes"/>
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('msxsl:node-set')">
<xsl:copy-of select="msxsl:node-set($gMyNodes)"/>
</xsl:when>

saxon 6's node set function is in the saxon namespace
xmlns:saxon="http://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="$gMyNodes"/>
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:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:saxon="http://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="vMyNodeSet">
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<msxml>
<xsl:copy-of select="msxsl:node-set($gMyNodes)"/><!-- saxon
error -->
</msxml>
</xsl:when>
<xsl:when test="function-available('saxon:node-set')">
<saxon>
<xsl:copy-of select="saxon:node-set($gMyNodes)"/><!-- saxon
error -->
</saxon>
</xsl:when>
<xsl:otherwise>
<ERROR>No node set function available, or missing
processor</ERROR>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNodeSet"/>
</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:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:saxon="http://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="vMyNodeSet">
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<msxml>
<xsl:copy-of use-when="function-available('msxsl:node-set')" select="msxsl:node-set($gMyNodes)"/><!-- saxon
error -->
</msxml>
</xsl:when>
<xsl:when test="function-available('saxon:node-set')">
<saxon>
<xsl:copy-of use-when="function-available('saxon:node-set')" select="saxon:node-set($gMyNodes)"/><!-- saxon
error -->
</saxon>
</xsl:when>
<xsl:when test="system-property('xsl:version')='2.0'">
<saxon8>
<xsl:sequence select="$gMyNodes"/>
</saxon8>
</xsl:when>
<xsl:otherwise>
<ERROR>No node set function available, or missing
processor</ERROR>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNodeSet"/>
</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
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...
6
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
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...
5
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:...
3
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...
5
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: ...
8
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: ...
6
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...
9
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
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.