XPath example

148 views
Skip to first unread message

roman...@gmail.com

unread,
Apr 5, 2017, 2:05:38 PM4/5/17
to XPath Tester help center

1) read Notes / suggestions below

2) Enter text between +++++ and ----- into a editor
+++++
<?xml version="1.0" encoding="UTF-8"?>
<myRootElement>
  <subElement>Hi There!<p>p1</p><p>p2</p>seg      seg2</subElement>
</myRootElement>
-----

3) Internet Explorer - start fresh, close Internet Explorer if open then start Internet Explorer

4) type this into the Internet Explorer address bar (or copy and paste)
http://www.xpathtester.com/xpath   then press enter

5) on the xPath tester   press >XPath   and select  XPath 2.0

6) switching focus to your editor copy and paste  lines you typed
into bottom pane of xPath tester

7) enter    normalize-space(string-join(/myRootElement/subElement/text(),""))
into the box just below   > XPath:    on the  xPath tester

8) press button Test
result should be
Hi there!seg seg2


Notes / suggestions
-------------------
These notes are written for the lowest common denominator system.
meaning a bare bones system right from the computer store


editor suggestion
1) start up Windows Notepad
2) change font to big proportional font
   Consolas regular  14

publishing quotes are ornate Unicode quotes
replace with plain ASCII quote (enter it from your keyboard)

Reply all
Reply to author
Forward
0 new messages