RE: XProc document templates - a question about undeclared variables

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 UTC