tags:

views:

32

answers:

1

How to parse the "File" node under "File and Folder Items" using Xpath

<TreeView>
- <Node>
  Catalog 
- <Node>
  Device Items 
  <Node>A1</Node> 
  <Node>A2</Node> 
  </Node>
- <Node>
  File and Folder Items 
  <Node>File</Node>              <-- here!!!
  <Node>Folder</Node> 
  </Node>
  <Node>CCC</Node> 
  </Node>
  </TreeView>
A: 
//Node[normalize-space(text())="File and Folder Items"]/Node[1]

See example.

Artefacto
it seems do not work
Carlos_Liu
@Carlos I've added a link showing it does work.
Artefacto
yes, it works. thank you
Carlos_Liu
Artefacto's solution is working for me.i think that safer is `//Node[normalize-space(text()[1])="File and Folder Items"]/Node[text()="File"]`
mykhal