Output Formatting

Escaped characters

Characters escaped by default

  • < :  &lt;
  • > :  &gt;
  • & :  &amp;
  • Certain whitespace characters may be escaped by default, including carriage returns (&#xD;)
  • For HTML output, by default, characters are not escaped

xsl:output

<xsl:output ... [indent="<yes,no>"] [cdata-section-elements="..."]/>
indent
  • Indents XML tags
cdata-section-elements
  • Outputs the element as a CDATA section (no output escaping)
  • cdata-section-elements attribute: Whitespace-separated list of elements

xsl:text

<xsl:text [disable-output-escaping="<yes,no>"]>...</xsl:text>
disable-output-escaping
  • The nested text is outputted exactly as-is (including whitespace)
  • For XML output, escaping is enabled by default
  • For HTML output, escaping is disabled by default

xsl:value-of

<xsl:value-of select="..." [disable-output-escaping="<yes,no>"]/>
disable-output-escaping
  • The nested text is outputted exactly as-is (including whitespace)
  • For XML output, escaping is enabled by default
  • For HTML output, escaping is disabled by default