[liblouis-liblouisxml] Re: semantic action files and xpath

  • From: Bert Frees <bertfrees@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 21 Mar 2014 20:06:34 +0100

Hi Michael,

The only other reason I can think of is that maybe the p element is in a 
namespace. In that case, put the following at the top of your semantic actions 
file:

namespaces foo=http://foobar/ns

and prefix p like this:

para &xpath(//foo:p)

HTH,
Bert

On 21 Mar 2014, at 19:39, Michael Whapples wrote:

> OK, I was not aware that it was compared against the document root, although 
> I think I tried that just to be sure. I decided to omit the double slash as 
> the documentation example does not give it.
> 
> As I only thought I had tried &xpath(//p) I decided to check again. Basically 
> same result.
> 
> I am certain the semantic action file I am editing is being used (it did 
> catch me out at first), as when I change it back to
>    para p
> the para style is applied and the output "Result (0 nodes):" is no longer 
> output.
> 
> Michael Whapples
> On 21/03/2014 18:18, Bert Frees wrote:
>> Hi Michael,
>> 
>> XPath works fine, but your expression doesn't match. The expressions are 
>> evaluated upon the document root. Change it to &xpath(//p) to make it work 
>> (note the double slash).
>> 
>> Bert
>> 
>> On 21 Mar 2014, at 19:04, Michael Whapples wrote:
>> 
>>> Hello,
>>> I cannot get xpath semantic actions working.
>>> 
>>> I tried changing line:
>>>    para p
>>> to
>>>    para &xpath(p)
>>> in epub.sem from the BrailleBlaster repository. It appears that the xpath 
>>> expression is never evaluating as true. In the output from file2brl I get a 
>>> line like:
>>> Result (0 nodes):
>>> and the para style is never applied to the paragraph elements.
>>> 
>>> Have I done something wrong in my xpath definition?
>>> 
>>> I had been trying with more complicated expressions which also were not 
>>> working, so decided to try something simple like this example.
>>> 
>>> Michael Whapples
>>> For a description of the software, to download it and links to
>>> project pages go to http://www.abilitiessoft.com
>> For a description of the software, to download it and links to
>> project pages go to http://www.abilitiessoft.com
> 
> For a description of the software, to download it and links to
> project pages go to http://www.abilitiessoft.com

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

Other related posts: