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

RE: XProc document templates - a question about undeclared variables

From: Philip Fennell <Philip.Fennell@marklogic.com>
Date: Mon, 8 Nov 2010 06:28:02 -0800
To: "vojtech.toman@emc.com" <vojtech.toman@emc.com>, "xproc-dev@w3.org" <xproc-dev@w3.org>
Message-ID: <D20C296D14127D4EBD176AD949D8A75A46E7E5CC@EXCHG-BE.marklogic.com>
Vojtech,

> It will try to evaluate all expression in curly braces. If any of them
> cannot be evaluated (because it is an invalid XPath expression, because
> of references to unbound variables, etc.), you will get an error.

I'd have to say then that the p:document-template, as it is currently envisaged, is only of limited value. I believe that, given there's a parameters port on this step, the evaluation should be based on those, and only those parameters that are available through that port. If you cannot find an instance of the parameter in the template then throw an exception by all means but don't assume that because you can't find a parameter for the context variable in the template that that is necessarily an error.


Regards


Philip Fennell
Consultant
MarkLogic Corporation

88 Wood Street, London. EC2V 7RS

Mobile: +44 (0) 7824 830 866

email  Philip.Fennell@marklogic.com
web    www.marklogic.com





-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf Of vojtech.toman@emc.com
Sent: 08 November, 2010 2:06 PM
To: xproc-dev@w3.org
Subject: RE: XProc document templates - a question about undeclared variables

> Does the document template step only look for those expressions it has
matching
> parameters for or does it try to evaluate all expressions in curly
braces. Would it
> throw an exception if it didn't find a matching parameter? I guess the
same situation
> would occur in XSLT document templates too where you've used AVTs.

It will try to evaluate all expression in curly braces. If any of them
cannot be evaluated (because it is an invalid XPath expression, because
of references to unbound variables, etc.), you will get an error.

Regards,
Vojtech


--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech
Received on Monday, 8 November 2010 14:28:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 8 November 2010 14:28:29 GMT