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

passing a nodeset into an xslt file.

hi all.

i've been trying to pass a nodelist (!=nodeset??) from my c# application to
some xsl transform to use.

the xsl code is as follows:
<xsl:stylesheet version="1.0" exclude-result-prefixes="extern msxsl local
xql" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:local="#local-functions"
xmlns:xql="#xql-functions" xmlns:extern="urn:dottraffic:lnk">
<xsl:template match="/">
<span>1
<xsl:variable name="rrr" select="extern:GetRss(1, 'amit')//item"/>
c:<xsl:value-of select="count($rrr)" /><br/>
</span>
</xsl:template>
</xsl:stylesheet>

the c# code is:
public XmlNodeList GetRss(long RssID, string Argument)
{
XmlDocument oDoc = new XmlDocument();
//oDoc.LoadXml(oRemote.Get(sTemplate, false));
oDoc.LoadXml("<root><item><title>amittitle</title></item></root>");
return oDoc.SelectNodes("//item");
}

when i debug and stop at the last line of the GetRss function i can see
that the SelectNodes functions does return one node. but the transform will
not go into the for-each.

any ideas anyone?

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #1
2 1820
amit L via DotNetMonster.com wrote:
i've been trying to pass a nodelist (!=nodeset??) from my c# application to
some xsl transform to use. public XmlNodeList GetRss(long RssID, string Argument)


In .NET nodeset is represented by XPathNodeIterator class.

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #2
Thanks a lot Oleg. I will try it.

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #3

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

Similar topics

4
by: David Blickstein | last post by:
I have an application where I have a shared "method" of selecting a nodeset. The method currently is duplicated everywhere it is needed but I'd like that code to be shared. The method also...
2
by: Craig Petrie | last post by:
The following transformation puzzles me when trying to transform XML to XML. I get an exception "THE EXPRESSION PASSED TO THIS METHOD SHOULD RESULT IN A NODESET" at the last line...
5
by: Tim Menninger | last post by:
I have seen the postings about passing XML into an XSL transformation. The problem is that I cannot use any XPath navigation in the XSL that won't generate an error. If I use <xsl:copy-of...
4
by: Alfred Taylor | last post by:
I essentially need a countif() function for xsl. Something to where I could do countif(node-set, condition). Rather than try to get too extreme, i decided to just write one for my countif() with...
1
by: Damien Goutte-Gattat | last post by:
I am using the .NET framework v2.0.40607 with Visual C# Express and I would like to create some custom XPath functions to use directly in a XSLT stylesheet. I called...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
2
by: Yarik | last post by:
Hello, I am not sure the subject of my post adequately describes the problem I am trying to solve, so I think a specific example would be helpful. Let's say there are XML descriptions of...
14
by: eric.goforth | last post by:
Hello, Is there any way to directly access an element in a nodeset? For example, if working with: <blahs rec_count="16"> <blah> <yada>abc</yada> </blah>
4
by: vaibhavp | last post by:
Hi, I am new to coding in Xslt and am stuck up on a problem for a very long time. I have to convert an xml file to html using xslt. I am using javax.xml.transform API for this. The xml file i...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.