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

XProc document templates - a question about undeclared variables

From: Philip Fennell <Philip.Fennell@marklogic.com>
Date: Mon, 8 Nov 2010 06:00:18 -0800
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <D20C296D14127D4EBD176AD949D8A75A46E7E5A2@EXCHG-BE.marklogic.com>
With respect to the recent announcement regarding Document Templates:


> The <p:document-template> step searches for XPath expressions, delimited by curly 
> braces, in a template document and replaces each with the result of evaluating the 
> expression. All of the parameters passed to the <p:document-template> step are 
> available as in-scope variable names when evaluating each XPath expression.

What would happen if I had chosen to in-line an XQuery main module in the document template thus (completely arbitrary example but illustrates the problem):

<p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            name="main" version="1.0">
  <p:option name="param" required="true"/>

  <p:in-scope-names name="vars"/>

    <p:input port="template">
          xquery version "1.0" encoding "utf-8";
          let $foo as xs:string := 'bar'
            element {$foo} {$param}

Here I have two XPath expressions containing variable names, one of which is bound to the XQuery let declaration and the other to the XProc pipeline option.

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. 


Philip Fennell

Mark Logic Corporation

E-mail: philip.fennell@marklogic.com
Mobile: +44 (0)7824 830 866 
Received on Monday, 8 November 2010 14:00:48 UTC

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