Outputting stylesheets (aliases)

Because XSLT documents are XML documents, they can be produced using another XSLT stylesheet. This approach might be used to convert other SGML/XML-based stylesheet languages into XSLT equivalents. Consider the following example stylesheet rule (from a fictional language):

<rule trigger="warning">
  <style type="block" format="bold">
    <trigger-rules/>
  </style>
</rule>

The transformation required needs to convert this into an XSLT template (a quite trivial task in this example), and replace the product-specific formatting information with HTML equivalents (in this case bold and paragraph tags):

<xsl:template match="warning">
  <P><B><xsl:apply-templates/></B></P>
</xsl:template>

The problem that arises is that the ...

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.