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

XslTransform.Transform fails when xsl contains node-set() Function

My transform in cludes a variable that holds a node set from the node-set()
extension function. It the transformation works fine when using MSXML2 or
msxsl.exe but not in VB.Net.

My code looks something like this:

Dim XP as New XPathDocument(XMLFileName)
Dim XSLT as New XslTransform
XSLT.Load(XSLTFileName)
Dim Out as New MemoryStream
XSLT.Transform(XP.CreateNavigaotr, Nothing, Out, Nothing) <-- Fails on this
line
Out.Position = 0
Dim XML as New XmlDocument
XML.LoadXml(New StreamReader(Out).ReadToEnd)

The exception says:
System.Xml.Xsl.XsltException: Function 'msxsl:node-set()' has failed. --->
System.Xml.Xsl.XsltException: Cannot convert the operand to 'Result tree
fragment'.

I've spent days trying to figure it out with no luck. Any suggestions?
Nov 12 '05 #1
5 5190


John Sever wrote:
My transform in cludes a variable that holds a node set from the node-set()
extension function. It the transformation works fine when using MSXML2 or
msxsl.exe but not in VB.Net.

My code looks something like this:

Dim XP as New XPathDocument(XMLFileName)
Dim XSLT as New XslTransform
XSLT.Load(XSLTFileName)
Dim Out as New MemoryStream
XSLT.Transform(XP.CreateNavigaotr, Nothing, Out, Nothing) <-- Fails on this
line
Out.Position = 0
Dim XML as New XmlDocument
XML.LoadXml(New StreamReader(Out).ReadToEnd)

The exception says:
System.Xml.Xsl.XsltException: Function 'msxsl:node-set()' has failed. --->
System.Xml.Xsl.XsltException: Cannot convert the operand to 'Result tree
fragment'.

I've spent days trying to figure it out with no luck. Any suggestions?


I don't think that .NET supports the node-set function.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2
And where is your XSLT code?
"John Sever" <jo*******@cascon.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
My transform in cludes a variable that holds a node set from the node-set() extension function. It the transformation works fine when using MSXML2 or
msxsl.exe but not in VB.Net.

My code looks something like this:

Dim XP as New XPathDocument(XMLFileName)
Dim XSLT as New XslTransform
XSLT.Load(XSLTFileName)
Dim Out as New MemoryStream
XSLT.Transform(XP.CreateNavigaotr, Nothing, Out, Nothing) <-- Fails on this line
Out.Position = 0
Dim XML as New XmlDocument
XML.LoadXml(New StreamReader(Out).ReadToEnd)

The exception says:
System.Xml.Xsl.XsltException: Function 'msxsl:node-set()' has failed. --->
System.Xml.Xsl.XsltException: Cannot convert the operand to 'Result tree
fragment'.

I've spent days trying to figure it out with no luck. Any suggestions?

Nov 12 '05 #3

"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message
news:c4*************@ID-152440.news.uni-berlin.de...
And where is your XSLT code?
By asking this I wanted to say that I have many examples of code, containing
the xxx:node-set() extension function, that works OK with the .Net Framework
1.1

Also, Msxml2 didn't implement XSLT -- it did implement an obsolete WD
dialect, which is no longer supported in either MSXML4 or .Net XslTransform.

Actually, what the error message says is quite clear -- you haven't provided
an RTF as argument to msxsl:node-set(), but something else -- e.g a string
or a number.

Show us your code and anyone will be able to point out the exact cause of
this error.
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html



"John Sever" <jo*******@cascon.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
My transform in cludes a variable that holds a node set from the

node-set()
extension function. It the transformation works fine when using MSXML2 or msxsl.exe but not in VB.Net.

My code looks something like this:

Dim XP as New XPathDocument(XMLFileName)
Dim XSLT as New XslTransform
XSLT.Load(XSLTFileName)
Dim Out as New MemoryStream
XSLT.Transform(XP.CreateNavigaotr, Nothing, Out, Nothing) <-- Fails on

this
line
Out.Position = 0
Dim XML as New XmlDocument
XML.LoadXml(New StreamReader(Out).ReadToEnd)

The exception says:
System.Xml.Xsl.XsltException: Function 'msxsl:node-set()' has failed. ---> System.Xml.Xsl.XsltException: Cannot convert the operand to 'Result tree
fragment'.

I've spent days trying to figure it out with no luck. Any suggestions?


Nov 12 '05 #4
I've have been able to use msxsl:the node-set() function successfully in
..NET 1.0 & .NET 1.1.

Could you share the XSLT &/or XML with us?

----
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:Oz**************@TK2MSFTNGP12.phx.gbl...


John Sever wrote:
My transform in cludes a variable that holds a node set from the node-set() extension function. It the transformation works fine when using MSXML2 or msxsl.exe but not in VB.Net.

My code looks something like this:

Dim XP as New XPathDocument(XMLFileName)
Dim XSLT as New XslTransform
XSLT.Load(XSLTFileName)
Dim Out as New MemoryStream
XSLT.Transform(XP.CreateNavigaotr, Nothing, Out, Nothing) <-- Fails on this line
Out.Position = 0
Dim XML as New XmlDocument
XML.LoadXml(New StreamReader(Out).ReadToEnd)

The exception says:
System.Xml.Xsl.XsltException: Function 'msxsl:node-set()' has failed. ---> System.Xml.Xsl.XsltException: Cannot convert the operand to 'Result tree
fragment'.

I've spent days trying to figure it out with no luck. Any suggestions?


I don't think that .NET supports the node-set function.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #5
Hi John,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #6

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

Similar topics

1
by: Animesh Sharma | last post by:
Hi, Following template matches correctly in MSXML4 but NOT with .Net XSL translator: <xsl:template match="//input]"> <--Do Some operation> </xsl:template>
5
by: Kevin Westhead | last post by:
I'm using XslTransform to apply a transform to an XML document, however I get validation problems when parsing the resulting XML document due to invalid whitespace. I'm passing in an XPathNavigator...
2
by: Graham Pengelly | last post by:
Hi I am trying to transform on System.Xml.XmlDocument into another using XslTransform without writing the object out to a file. I am guessing it should work something like this... public...
1
by: Bob Yuan | last post by:
Hi, I am working on a asp.net project that takes a xml source and use XslTransform.transform to generate a xhtml output. The problem with using XslTransform is that it automatically reformats...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
2
by: Mr Flibble | last post by:
Hi All I've decided to put my stylesheets in a base64 .resource file for deployment and versioning reasons. I dont know if it's a great idea to do this but I couldn't think of another way of...
1
by: Praveen | last post by:
Have a common function in Javascript which do transform for all .xsl's. XSL object is loaded like this. var xslobj=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0"); xslobj.async = false;...
3
by: =?Utf-8?B?R2F1cmF2?= | last post by:
Hello, I am using translate in my .xslt to remove the space like this: <xsl:for-each select=".//Illustration"> <xsl:value-of select="translate(./@illusName, ' ', '')"/> But this doesn't...
9
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to...
1
by: sudhaMurugesan | last post by:
Hi all, I am using VS2003. I am new to VS2003. I cannot transform an xml file into a string output in my windows application. But the same function works well with VS2005. it also asks for...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.