I am rather surprised that namespaces can't be registered with an xpath expression. The debugging code for doing so can be modified and a new pseudo-action introduced to call it. John On Fri, Jan 15, 2010 at 11:21:30AM +0100, Christian Egli wrote: > "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx> writes: > > > I don't think the problem is related to namespaces, because the tags in > > Bookshare documents, which I am using for testing, don't have namespace > > prefixes. Also expressions using the local-name function still give > > empty node sets. > > Hm, I'm quite convinced that it is a namespace problem. I'd have to see > the Bookshare documents you are using for testing. > > I just checked in some debugging code to semantics.c which prints a > nodeset and which registers a prefix/namespace pair with libxml2. The > test files that I have been using are also in svn. The test files now > use both the local-name method and the method with the prefix (which > presumes that the prefix is registered with libxml2, which I have > hardcoded for debugging purposes for now). The test file in > tests/bert.xml uses an default (empty) namespace for all the elements > (see the xmlns="http://www.daisy.org/z3986/2005/dtbook/"; attribute in > the root node 'dtbook'). So if you update from svn you should be able to > run the following from a command line: > > $ cd ~/src/liblouisxml > $ libtool --mode=execute tools/xml2brl -f tests/bert.cfg tests/bert.xml > > This should list nine nodes twice. Once they are matching with the > local-name method and the second time because with namespace prefixes. > So I do get a non-empty nodeset. > > Once we get this working we can dump the debugging code again and find a > way to let the user register namespaces in the sem file. > > > We are making good progress! > > I think so too! > > Thanks > Christian > -- > Christian Egli > Swiss Library for the Blind, Visually Impaired and Print Disabled > Grubenstrasse 12, CH-8045 Z??rich, Switzerland > For a description of the software and to download it go to > http://www.jjb-software.com -- 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 and to download it go to http://www.jjb-software.com