RE: XProc document templates - a question about undeclared variables

Norm,

> Are you saying that an expression in curly braces that 
> raises an error when it's evaluated should be left alone?

No.

I see that, in effect, what you are attempting to create with the p:document-template is something akin to the simplified xslt stylesheet which, in this case, is just laced with AVTs.

My example was, as I said, somewhat arbitrary but designed to find out what happens when you have other expressions you don't want evaluated at that point.

I think you've all answered my questions and I understand what it was that you'd originally intended.

Many thanks

Philip

-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf Of Norman Walsh
Sent: 08 November, 2010 2:41 PM
To: XProc Dev
Subject: Re: XProc document templates - a question about undeclared variables

Philip Fennell <Philip.Fennell@marklogic.com> writes:
> 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.

Are you saying that an expression in curly braces that raises an error when it's evaluated should be left alone?

  ...<example attr1="{3+4}" attr2="{1 div 0}"/>...

should become

  ...<example attr1="7" attr2="{1 div 0}"/>...

?

Uh. Yuck. I don't like that at all.

As I said a moment ago, if you're passing the template result to XQuery or XSLT, then you can just do all the work in there. The template step is for the simpler (and in my experience more common and more easily understood) cases.

                                        Be seeing you,
                                          norm

--
Norman Walsh
Lead Engineer
MarkLogic Corporation
www.marklogic.com

Received on Monday, 8 November 2010 14:54:32 UTC