Jonathan Revusky wrote:
Robert Koberg wrote:

Daniel Dekany wrote:

No template language can be too good at that... Simply, the basic idea
of a template languages is incompatible with strict white-space control.



You get strict whitespace control with XSL/XML :)


I am pretty sure that XSL/XML has the same problems wrt whitespace that template languages do.

No, you have several options. In the XML source you have xml:space="preserve".

In XSL you have:

<xsl:output indent="yes | no" .../>

<xsl:strip-space elements="*"/> <!-- *=all-elements or you could specify exactly which elements -->

<xsl:preserve-space elements="script textarea"/>

<xsl:stylesheet xml:space="default | preserve" .../>

When outputting text you can use entities to place linebreaks, tabs, spaces, etc. You can also use:

<xsl:text>This is a
linebreak</xsl:text>

or:

<xsl:text>This </xsl:text>
<xsl:value-of select="$variable"/>
<xsl:text> is on one line.</xsl:text>

When setting output for certain methods like HTML or XHTML it follows the DTD/Schema rules associated.

To me, the semantics are clear. I have trouble understanding why people find it hard to understand (but they do...).

Oh.... I forgot something. XSLT is not really readable by mortal humans anyway, so maybe the point is kind of moot....


Many humans like the way XSLT reads. YMMV.

-Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to