Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Scripts

Reply
 
LinkBack Thread Tools Display Modes
Old 04-27-2005, 10:38 PM   #1 (permalink)
New Member
 
Join Date: Mar 2005
Posts: 6
Default ASP/XML - SearchDOMTreeByName(Input)

USing ASP to parse XML - Is there a reasonably simple and dynamic way to search the DOM Tree by node names? I realise that I may need more than one parameter to identify none unique nodes, just wondered if anyone had a function I could have a look at, or some advice.

I have made a small start:

<%
'create the xml document object
set XMLDoc = server.createobject("Microsoft.XMLDOM")
'Specifies whether asynchronous download is permitted.
XMLDoc.async = false
'Load local test document -
XMLDoc.load(server.mappath("weathertest.xml"))
'Create a root Node from the XML document element
set rootNode = XMLDoc.documentElement

'Create a function to search the DOM tree by node name
Function SearchDOMTreeByName(Input)
'Walk the tree, I presume I need to set up a loop that identifies the level of children..
'and continues until it reaches the end leaves or finds the node with the required input name but don't know how
'**HELP!**
'Return the required text value
SearchDOMTreeByName=x.text
End Function

'test the function
response.Write(SearchDOMTreeByName("head"))
'Close the XML object
set XMLDoc=nothing
%>

I have actually already wrote a function that works for my application but would like something less hard wired as it only searches to a set level of nodes and refers to there positions in the tree, the call look like this:

GetNode(3,1,4,2,0)

Thanks for your time if you can help.
kx10 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:12 AM.


Computer Forum - Internet Business - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.