[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Nodeset problems

Subject: Nodeset problems
From: Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx>
Date: Wed, 27 Jul 2005 14:55:55 +0200
xsltargumentlist nodeset
Hi again,

I asked something about keys and nodesets before. I haven't even
gotten to that particular problem yet, because I have run into some
others.

In .NET, I have:

System.Xml.XPath.XPathNodeIterator oInputNodeSet =
oInput.CreateNavigator().Select("//*");
XsltArgumentList args = new XsltArgumentList();
args.AddParam("Input","",oInputNodeSet );
System.IO.Stream str = new System.IO.MemoryStream();
oXsl.Transform(oXml, args, str);
....

In my XSL I have:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		 xmlns:ms="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml"/>
<xsl:param name="Input"/>  <!-- document(Input.xml',/) -->
<xsl:variable name="Test-Input" select="ms:node-set($Input)"/>

<xsl:template match="/">
<Root>
  <test><xsl:copy-of select="$Input"/></test>
  <test2><xsl:copy-of select="$Input/root"/></test2>
  <test3><xsl:copy-of select="$Input/root/something[1]"/></test3>
  <test4><xsl:copy-of select="$Test-Input/root/something[1]"/></test4>
</Root>
</xsltemplate>
</xsl:stylesheet>

The param "Input" worked perfectly when it was passed as an XML file.
Now, I get the whole nodeset in <test> .. </test>
I get nothing in <test2> .. </test2> or <test3> .. </test3>

My variable Test-Input and the <test4> .. </test4> I just resently
tried. The problem is that the variable Test-Input throws an error:
(Translated)
The function 'ms:node-set()' failed. --> The operand could not be
converted to a 'fragment of a resultset'. (I think, the last word is
garbled)
(The error message in Danish if I should be so lucky that anyone will
understand that - and be able to help):
"Funktionen 'ms:node-set()' mislykkedes. --> Operanden kan ikke
konverteres til et 'fragment af et resultattr&#230;'. "

The oInput is an Xml document:
<?xml version="1.0" encoding="iso-8859-1" ?>
<root>
  <something someattribute="1">number 1</something>
  <something someattribute="2">number 2</something>
  <something someattribute="3">number 3</something>
  <something someattribute="4">number 4</something>
</root>

oXml does not matter in this example at all - I haven't even gotten to
parse that yet in this testing...

This worked perfectly when I tested it, where it was in the document
Input.xml, but now I try to convert it into the nodeset and pass it as
a parameter, and it seems to exibit the same behavior as if it was an
RTF - except that I cannot convert it to a node-set using the MS
extension function.

Can anybody tell me what is wrong from what I have posted?

Thank you very much.
Regards,
Ragulf Pickaxe :-|

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.