XML: Using XPath navigation to enumerate certain xml nodes 
Author Message
 XML: Using XPath navigation to enumerate certain xml nodes

Hello

Im trying to write a SeletNodes query in for a xml model. Please look
at this file:

http://www.*-*-*.com/ %2...

In this hierarchy, Im trying to select all the child nodes in
<WatchFolders> which have an attribute of SyncAction. Im writing this
code:

xmlDom.Load (filename)
Set xmlDM = xmlDom.SelectSingleNode("DocumentManager")
Set xmlWatchFolders = xmlDM.SelectSingleNode("WatchFolders")


The above query works ok but the problem with it is that it enumerates
only the parent level, and doesnt go into the children of each node. I
want to write a query that returns ALL the nodes, including child
nodes, which have an attribute of SyncAction.

Any help?
Faraz Azhar



Thu, 15 Mar 2012 15:48:26 GMT  
 XML: Using XPath navigation to enumerate certain xml nodes
Never mind... I figured it out. I had to set the following syntax:


The two slashes made the difference.



Thu, 15 Mar 2012 16:14:33 GMT  
 XML: Using XPath navigation to enumerate certain xml nodes
This series of articles may be of some interest to you, involving the XPath
syntax:  http://www.w3schools.com/xpath/xpath_syntax.asp

--
2025
If you do not believe in time travel,
your beliefs are about to be tempered.

http://www.facebook.com/group.php?gid=43606237254

| Never mind... I figured it out. I had to set the following syntax:
|
| Set xmlNodeList = xmlWatchFolders.SelectNodes("//Document

|
| The two slashes made the difference.



Thu, 15 Mar 2012 22:53:06 GMT  
 XML: Using XPath navigation to enumerate certain xml nodes

Quote:
> This series of articles may be of some interest to you, involving the XPath
> syntax: ?http://www.w3schools.com/xpath/xpath_syntax.asp

> --
> 2025
> If you do not believe in time travel,
> your beliefs are about to be tempered.



> | Never mind... I figured it out. I had to set the following syntax:
> |
> | Set xmlNodeList = xmlWatchFolders.SelectNodes("//Document

> |
> | The two slashes made the difference.

Thanks! Thats exactly where I found the solution! its a great website
of XPATH syntax.


Fri, 16 Mar 2012 22:59:02 GMT  
 XML: Using XPath navigation to enumerate certain xml nodes


Quote:
> This series of articles may be of some interest to you, involving the
> XPath
> syntax:  http://www.w3schools.com/xpath/xpath_syntax.asp

My experience with W3Schools is that it's a good starting point but doesn't
cover everything in depth. So the moral: don't stop there! Once you've
learned what you can from that site, find others for your advanced training.


Fri, 16 Mar 2012 23:32:44 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Trying to append a simple XML document as a node in an XML document

2. xPath to access to another XML island

3. ADO, XML, XPath & SQL Server

4. ADO, XML, XPath & SQL Server

5. XML copy subnodes from one node to another node in another doc

6. XML copy subnodes from one node to another node in another doc

7. Read XML using VB6 DOM 4.0 with Namespaces - See Sample XML

8. XML text node containing escaped xml --> xml fragement

9. hyperlinking a node in one xml file to a node in another xml file??? Best way??

10. Remove node in a view xml

11. XML, Converting Word doc's to XML files (O'2000)

12. How to create a secure connection, send an xml msg and receive and xml response

 

 
Powered by phpBB® Forum Software