lucavilla
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="navig ation"]/di v/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?
XQUERY:
declare default element namespace 'http://www.w3.org/1999/xhtml';
doc('FILE:///C:/temp/page.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.