Document template test 10

The heart of test 10 is this expression:


There are two possible interpretations:

  "{" "/doc/p" "}"


  "{" "/doc/p}" "}"

The former yields a valid expression, the latter an invalid one.

The problem I have is this case:

  { concat('{{', $foo, '}}') }

There are two possible interpetations here too:

  " concat('{', $foo, '" ... error because there's an unbalanced "}"


  " concat('{', $foo, '}') "

If we say that "}" ends an expression when we're inside one, then the
first expression is valid and the second is not. If we say that "}}"
is matched even when we're inside an expression then the first
expression is invalid and the second is valid.

On the whole, I prefer the latter interpretation. In either case,
there are some sequences of values that cannot be constructed using
the document-template step. We'd have to have more complex parsing
rules to avoid that problem, but I'd rather not.

                                        Be seeing you,

Norman Walsh
Lead Engineer
MarkLogic Corporation

Received on Wednesday, 17 November 2010 15:34:26 UTC