W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > February 2010

RE: multiple inputs in test expressions?

From: <Toman_Vojtech@emc.com>
Date: Fri, 5 Feb 2010 05:14:36 -0500
Message-ID: <997C307BEB90984EBE935699389EC41CA7D73C@CORPUSMX70C.corp.emc.com>
To: <public-xml-processing-model-comments@w3.org>
I am afraid you would indeed have to merge the documents in your
example. The XPath context for the test expression is at most one
document, so you can't query across two documents here.

Using XSLT for merging the documents is one option, but XProc provides
(probably much more efficient) alternatives: for instance, the
p:wrap-sequence step.

Another approach could be to use p:xquery to query across the documents,
and then use the result of the p:xquery step in your p:choose/p:when.
That would eliminate the need for merging the documents.

Regards,
Vojtech


> -----Original Message-----
> From: public-xml-processing-model-comments-request@w3.org
[mailto:public-xml-
> processing-model-comments-request@w3.org] On Behalf Of fikin
> Sent: Thursday, February 04, 2010 8:59 PM
> To: public-xml-processing-model-comments@w3.org
> Subject: multiple inputs in test expressions?
> 
> i have a case of value lookup withing a secondary input document.
> 
> <p:input name="source" primary="true" />
> <p:input name="src2" />
> <p:choose>
>    <p:when test="/tags/tag[ @name= $src2/tags/tag/@name ]"
>...</p:when>
> </p:choose>
> 
> is there a way to make it working without merging the two documents
> with xslt first?
> 
> 
Received on Friday, 5 February 2010 10:16:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 5 February 2010 10:16:09 GMT