|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
XSL for searching a NodeList for a Node or Nodes
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 <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 all employees called John in the current department passed in. 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. If I could do that I would use for example function getEmployeeRecords(nodeList) { return nodeList.selectNodes("/employee[@name='John']"); } The problem is that nodeList is a list of EMPLOYEE. How can I return a nodeList from my function which is all EMPLOYEE nodes in nodeList with name = John? |
|
#2
|
|||
|
|||
|
Your mileage may vary, but with this xml:
Code:
<employees> <employee> <name>John</name> <department>Shipping</department> </employee> <employee> <name>Jack</name> <department>Shipping</department> </employee> <employee> <name>John</name> <department>Receiving</department> </employee> </employees> this xpath: //employee[department="Shipping"][name="John"] selects the John in Shipping.
__________________
-james Last edited by bricker42 : July 2nd, 2003 at 07:03 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSL for searching a NodeList for a Node or Nodes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|