Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML FILTERING(very urgent)

Status
Not open for further replies.

nikhilparchure

Programmer
Oct 6, 2001
121
AU
scenario i have a problem
[Filtering of an in-memory created XML node]

lets us have an example that will cite my problem
<XML>
<XYZ CORP>
<NAME>XYZ Corporation </NAME>
<YEARS>20 </YEARS>
<XYZ CORP>
<ABC LTD>
<NAME>XYZ Corporation </NAME>
<YEARS>17 </YEARS>
<ABC LTD>
</XML>

suppose my XML node is created in such a way

and i have to filter it such that i get company which has minimum years
i.e. i have to get a node corrosponding to &quot;ABC LTD&quot;

I am using XML Dom component for parsing this

well this can be doing looping thru the nodes and we can have have corrosponding node having minimum years

well do u have a solution where this can be done using some in-built XML function i.e to give the node which has minimum
years

Well the scenario seems eazy out here bcoz i have taken
only 2 nodes in consideration
but where i am coding i have about 1000 nodes created at a point of time. so looping will consume time

do u ppl have any remedy
pls help guys this is urgent

thanks in advance

nikhil

 
Hi,

You can search the collection of nodes for a specific value using the selectSingleNode or selectNodes methods from the DomDocument object

To find a specific value anywhere in the document use the following syntax

Code:
set oNode = DomDocument.selectSingleNode(&quot;//YEARS[. = '20']&quot;)
I hope that this helps

B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top