XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 1st, 2003, 10:12 AM
adcworks2 adcworks2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 5 adcworks2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old July 2nd, 2003, 03:05 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL for searching a NodeList for a Node or Nodes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway