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

Getting a NodeList from a NodeList

Subject: Getting a NodeList from a NodeList
From: "Allistair Crossley" <Allistair.Crossley@xxxxxxx>
Date: Tue, 1 Jul 2003 17:16:27 +0100
nodelist selectnodes
Hi 

I am using XSL and MSXML 4 to do some reports. I have a main body of XSL which selects from an XML tree all employees who belong to a particular department which is a list being looped over already. The current department value is stored in $deptName

<xsl:for-each select="mycomp:getFilteredEmployeeRecords(//employee[./@department = $deptName])"> 

Here, I am passing the result of "all employees in the current department" to a MSXSL:SCRIPT function where I want to filter the node list even more and return it. 

Let's say I want a node list of all employees called John from the node list that I pass into the function to come out.

My problem is that nodeList is a DOMNodeList and does not have what I need to select another nodeList from it...i.e Node's selectNodes. All it has is the ability to get a node. 

I want to do something like

function getEmployeeRecords(nodeList) { 
return nodeList.selectNodes("/employee[@name='John']"); 
} 

The problem is that nodeList is a list of EMPLOYEE nodes. 

How can I return a nodeList from my function which is all EMPLOYEE nodes in nodeList with name = John?

I have thought about sibling functions but I am not sure.

Allistair Crossley 
Senior Intranet Developer
QAS Ltd 
Direct Dial: 020 7819 5343 



<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.