Link to home
Start Free TrialLog in
Avatar of lucavilla
lucavillaFlag for Italy

asked on

how to get a simple text string as results of a XQuery with Saxon

With Saxon (& tagsoup parser) command-line I launch this xquery to extract a number out of an html page:

XQUERY:
 declare default element namespace 'http://www.w3.org/1999/xhtml';
 doc('FILE:///C:/temp/page.html')//*[@id="navigation"]/div/a/span

The result "correctly" show the answer:
 <?xml version="1.0" encoding="UTF-8"?>
 <span xmlns="http://www.w3.org/1999/xhtml"
 xmlns:html="http://www.w3.org/1999/xhtml">2</span>

However I just want that cleaned "2" as simple text string.
How can I modify the XQuery or the command line Saxon switches to just get the simple text string?
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial