xsl-list
[Top] [All Lists]

Nodeset problems

2005-07-27 05:55:55
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 :-|

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>