[liblouis-liblouisxml] Re: xpath implementation and other new features

  • From: Bert Frees <bert.frees@xxxxxxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Mon, 11 Jan 2010 10:36:30 +0100

**I'm afraid revision 203 did not fix the bug.

On 8/01/2010 18:50, John J. Boyer wrote:
This is a simple bug and will be easy to fix.

John

On Fri, Jan 08, 2010 at 04:34:00PM +0100, Bert Frees wrote:
I think there is a problem with the handling of xpath expressions. My
simple example looks like this:

     para p
     no&xpath(//td/p)

So basically, "p" has to be formatted as a paragraph only when it isn't
a child of "td".
Unfortunately I get this error:

XPath error : Invalid expression
//td/p)
       ^

The arrow points to the closing parenthesis. (My guess is that the
algorithm interprets this parenthesis as a part of the xpath expression
and therefore concludes that the parentheses don't match.)

Bert


On 29/12/2009 3:46, John J. Boyer wrote:
liblouisxml svn now has an implementation of the handling of xpath
expressions. I am now testing and documenting it. For those who want to
give it a try, place an ampersand in column 2 of a .sem file, then
"xpath", then the expression in parentheses. The expression may contain
parentheses if they are matched. For example:

heading1&xpath(/level/hd)
heading2&xpath(/level/level/hd)

This notation can be extended to support other xml features, such as
XPointer. The code is in semantics.c. The function do_xpath_expr
evaluates xpath expressions. To find the code which interprets them in
.sem files look for '&'

There is a new check for duplicate entries in .sem files.

There is also a new pdf2brl tool, but automake doesn't like it for some
reason, so it isn't built yet.

Let me know if you see any problems with the notation for xpath
expressions. I'll be documenting it.

Thanks,
John


For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: