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 2.6.2.2)  
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:identity>
	<p:input port="source">
		<p:inline>
			<list>
				<item att='a'/>
				<item att='b'/>
			</list>
		</p:inline>
	</p:input>
</p:identity>
<p:label-elements label="//item[position()=$p:index]/@att" match="list/ 
*"/>

To return:

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

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...

BR,
Romain.


--
Romain Deltour, Software Developer/Architect
The DAISY Consortium
http://www.daisy.org
Received on Wednesday, 10 March 2010 09:23:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 March 2010 09:23:28 GMT