RE: Document template test 10

> If we say the latter : we can have }} inside } irrespective to the
> fact that it's in a string or anything else we could rewrite the first
> example as
> { concat('{{', /doc/p, '}}') }
> 
> And I will be perfectly happy this way
> 
> So let's go for this parsing rules
> 
> Normal mode
> 1) IF you parse {{ then output {
> 2) IF you parse }} then output }
> 3) IF you parse { then switch to 'xpath mode'
> 4) IF you parse } then it's an error
> 5) IF you parse anything else output it as is
> 
> Xpath mode
> 1) IF you parse {{ then output {
> 2) IF you parse }} then output }
> 4) IF you parse { then it's an error
> 3) IF you parse } then switch to 'normal mode' and evaluate the string
> in the buffer as the xpath expression
> 5) IF you parse anything else output it as is
> 
> Mohamed

OK, so if you want to output "{" /doc/p "}", you will have to use
concat():

{{{concat(/doc/p, '}}')}

or: {concat('{{', /doc/p, '}}')}

I think that is reasonable.


Vojtech


--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

Received on Thursday, 18 November 2010 08:34:41 UTC