[liblouis-liblouisxml] Re: XPath Question

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: Christian Egli <christian.egli@xxxxxxxx>
  • Date: Thu, 23 Sep 2010 04:35:17 -0500

Christian,

This helps. Now If I can figure out how to use the string function in a 
program. I will have a pointer to the node, which will be in a parse 
tree.

Thanks,
John

On Thu, Sep 23, 2010 at 10:57:20AM +0200, Christian Egli wrote:
> Hi
> 
> "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx> writes:
> 
> > Suppose I have the following subtree
> >
> > <brl>
> > <newline/>
> > This is the first line.
> > <newline/>
> > This is the second line.
> > </brl>
> >
> > What is the Xpath expression for extracting the string-value of the
> > <brl> node? How would I get this string-value using
> > xmlXPathevalexpression?
> 
> If I understand correctly what you want is "string(brl)". A (crude) way
> to test this is the shell in xmllint. Save the above xml in a file, say
> foo.xml. Then invoke the shell in xmllint:
> 
> $ xmllint --shell foo.xml
> / > cat
> <?xml version="1.0"?>
> <brl>
> <newline/>
> This is the first line.
> <newline/>
> This is the second line.
> </brl>
> 
> / > xpath string(brl)
> Object is a string :   This is the first line.  This is the s...
> / > quit
> 
> Hope that helps
> -- 
> Christian Egli
> Swiss Library for the Blind, Visually Impaired and Print Disabled
> Grubenstrasse 12, CH-8045 Z??rich, Switzerland

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities

For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: