Re: Is the xpath() xpointer scheme namespace-aware?

On 08/06/2013 01:57 AM, Geert Josten wrote:
> Sounds like it should be possible in principle. Are you observing
> unexpected output or errors?

Sorry, neglected to mention those details:

If I refer to an element unprefixed, *[not(self::title)], it doesn't
match the element (i.e. the title elements appear in the result doc).

If I use a prefix, *[not(self::db:title)] where 'db' is bound to
http://docbook.org/ns/docbook, I get the error:

XD0023:Expression could not be evaluated

Reading http://www.w3.org/TR/xproc/#err.inline.D0023, it seems like both
of these should work: "When the XProc processor evaluates an XPath
expression using XPath 1.0, unless otherwise indicated by a particular
step, it does so with the following initial context...in-scope
namespaces...The namespace bindings in-scope on the element where the
expression occurred."

Regards,
David

> 
> Kind regards,
> Geert
> 
>> -----Oorspronkelijk bericht-----
>> Van: David Cramer [mailto:david@thingbag.net]
>> Verzonden: maandag 5 augustus 2013 23:04
>> Aan: XProc Dev
>> Onderwerp: Is the xpath() xpointer scheme namespace-aware?
>>
>> Hi there,
>> I'm processing DocBook xml with Calabash and using xinclude with the
>> xpath() scheme to pull in all the children of a section EXCEPT for the
>> title. The following works fine, but is inelegant:
>>
>> <xi:include
>> href="test.xml"
>> xpointer="xpath(//*[@xml:id = 'test']/*[not(local-name(.) = 'title')])">
>>
>> I was expecting to be able to do:
>>
>> //*[@xml:id = 'test']/*[not(self::title)]
>>
>> or (assuming I'd bound http://docbook.org/ns/docbook to 'db'):
>>
>> //*[@xml:id = 'test']/*[not(self::db:title)]
>>
>> Is the xpath scheme namespace-aware?
>>
>> Regards,
>> David

Received on Tuesday, 6 August 2013 14:14:32 UTC