|[Xpand] Controlling Whitespaces [message #545893]
||Fri, 09 July 2010 14:32
Originally posted by: pete.cheyne.yahoo.com|
I am wondering whether there is any good way to control the whitespaces
within an Xpand template. It seems to me that either the structure of
the template is readable _or_ it produces the output that you want, but
you cannot have both. Essentially, I am maybe looking for something that
allows me do it like in XSLT with the <xsl:text> </xsl:text> tags which
allow me to format the template as I like and just have the literal text
inbetween these tags. Or simply some other way to preserve the
control-flow structure within the template by formatting without
destroying the output.
All that I have read in the documentation is the pointer to use a pretty
printer, but such a pretty printer is not always available, especially
not as an MWE workflow component.
Do you know how Acceleo or Jet deal with this problem? Are they better
in this regard?
|Re: [Xpand] Controlling Whitespaces [message #546567 is a reply to message #545893]
||Tue, 13 July 2010 11:50
| Alexander Nittka
Registered: July 2009
I don't know of a good way to have both at the same time. The main
problem is that all text characters make their way to the file. A
debatable workaround is using the following:
a) put additional white spaces whithin the tags in order to achieve
indentation << IF expression->>
b) use dummy tags in order to achieve indentation whithout producing
white spaces in the output
A code beautifyer will almost always be the best alternative.
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to email@example.com
Powered by FUDForum
. Page generated in 0.02965 seconds