W3C home > Mailing lists > Public > xproc-dev@w3.org > March 2010

xpath context in p:label-elements/@label (bug in Calabash?)

From: Romain Deltour <rdeltour@gmail.com>
Date: Mon, 8 Mar 2010 15:37:26 +0100
Message-Id: <1F0B078B-E1F0-4A49-AA69-3F514E1A11C5@gmail.com>
To: xproc-dev@w3.org
Hi all,

(this is my first post to this list and I still learn new things on  
XProc everyday, so please forgive me if I miss something obvious...)

It seems that Calabash doesn't set the context before evaluating the  
XPath expression in the p:label-elements/@label

The spec says that "The value of the label option is an XPath  
expression used to generate the value of the attribute label" (sect  
7.1.13) and the generic section on step XPath contexts (sect  
says it should be "The document node of the document that appears on  
the primary input of the step, unless otherwise specified by the step" .

I was expecting the following steps:

	<p:input port="source">
				<item att='a'/>
				<item att='b'/>
<p:label-elements label="//item[position()=$p:index]/@att" match="list/ 

To return:

	<item att="a" xml:id="a"/>
	<item att="b" xml:id="b"/>

But Calabash reports:
SEVERE: Underlying exception:  
net.sf.saxon.s9api.SaxonApiUncheckedException: Finding root of tree:  
the context item is undefined

Also, if it happens to be a bug in Calabash, the XProc test suite  
might be augmented to catch this scenario...


Romain Deltour, Software Developer/Architect
The DAISY Consortium
Received on Wednesday, 10 March 2010 09:23:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:06 UTC