Jean-Michel Hiver wrote: > something like: > > <div dir="<!--VAR language_dir -->"> > <!--VAR some_content--> > </div> > > Which is completely impossible to validate and IMHO very hard to read.
Agreed. The following is easier to read, IMHO, and is also valid XML markup. <div dir="[% language_dir %]"> [% some_content %] </div> > <div > dir="ltr" > petal:attributes="ltr language_dir" > petal:content="some_content"> > > > Hello, World > </div> I accept that it's a clever approach, but I think it's the hardest to read of all three. Both the original values and also the Petal replacement instructions are present in the element. The reader has to mentally match them up to figure out what's going on. It's hard to see at a glance that 'Hello World' is replaced by 'some_content', for example, without checking the element attributes. I'm sure that once you're in the Petal mindset it all make sense much more quickly. But you're right in saying that it's strange at first! > If you like a more straightforward approach, Petal also lets you write: > > <div dir="$language_dir"> > $some_content > </div> If you like a more straightforward approach, TT also lets you write: <div dir="$language_dir"> $some_content </div> See, I knew there would be something that we would agree on! :-) > But at the risk of breaking compatibility with some validators / XML > tools / etc. It still looks like valid XML to me. Where is the incompatability? Am I missing something obvious? A