Documentation

Index

XSL(T) - Extensible Stylesheet Language (Transformation)

Ensure open/close XML/(X)HTML tags

The main code is

<xsl:text xml:space="preserve"><![CDATA[]]></xsl:text>

So you can create a script tag:

<script>
  <xsl:text xml:space="preserve"><![CDATA[]]></xsl:text>
</script>

which then looks like:

<script></script>

or a textarea tag:

<textarea>
  <xsl:value-of select="ns:AnyText"/>
  <xsl:text xml:space="preserve"><![CDATA[]]></xsl:text>
</textarea>

which could look like:

<textarea>Content of AnyText source element</textarea>

or:

<textarea></textarea>

when XML element ns:AnyText not exists, has white space only or is empty.


© SphereSoft.NET, Holger Boskugel, Berlin, Germany spheresoft.net