Non-XML output

It may seem to be obvious that it is not necessary for the output to be an XML document. When there is a need to transform an XML document into a proprietory format, it would seem to be possible simply to avoid entering any XML markup in the replacement text. With some limitations – which can be overcome – this assumption is correct. The following example produces RTF (Rich Text Format) output:

<template match="note">
  \pard\fs24<xsl:apply-templates/>\par
</template>

The only problem with this is that special characters are represented by XML entity references, due to the assumption that the output file will be read by an XML parser. In particular, if the characters '<', '>' or '&' appear in the replacement text, they will be ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.