<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ml="http://nwalsh.com/ns/ml-macro#"
                xmlns="http://www.w3.org/1999/xhtml"
                exclude-result-prefixes="xsl ml"
                version="1.0">

<rdf:Description rdf:about=''
                 xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
                 xmlns:cc="http://web.resource.org/cc/"
                 xmlns:dc='http://purl.org/dc/elements/1.1/'
                 xmlns:dcterms="http://purl.org/dc/terms/">
  <!--<rdf:type rdf:resource="http://web.resource.org/cc/Work"/>
  <rdf:type rdf:resource="http://norman.walsh.name/knows/taxonomy#XSL"/>
  <dc:type rdf:resource='http://purl.org/dc/dcmitype/Text'/>
  <dc:format>application/xsl+xml</dc:format>
  <dc:title>Macro expansion stylesheet</dc:title>
  <dc:date>2006-02-04</dc:date>
  <dc:creator rdf:resource='http://norman.walsh.name/knows/who#norman-walsh'/>
  <dc:contributor rdf:resource="tag:jlc6@po.cwru.edu,2005:self"/>
  <dc:isVersionOf rdf:resource="http://norman.walsh.name/2006/01/06/examples/ml-macro.xsl"/>
  <dc:rights>Copyright &#169; 2006 Norman Walsh. This work is licensed under the Creative Commons Attribution-NonCommercial License.</dc:rights>
  <cc:license rdf:resource="http://creativecommons.org/licenses/by-nc/2.0/"/>
  <dc:description>Expands macros in text content and attribute values. See http://norman.walsh.name/2006/01/06/doctype or http://infinitesque.net/articles/2006/doctype-xslt1/.</dc:description>-->
</rdf:Description>

<xsl:output method="xml" encoding="utf-8" indent="no"/>

<xsl:template match="comment()" mode="pre">
  <!--<pre><xsl:value-of select="."/></pre>-->
</xsl:template>

<xsl:template match="comment()" mode="doc">
  <p><xsl:value-of select="."/></p>
</xsl:template>

<xsl:template match="ml:macro">
  <tr>
    <td><xsl:value-of select="@name"/></td>
    <td><xsl:value-of select="."/></td>
    <td><xsl:value-of select="following-sibling::comment()[1]"/></td>
  </tr>
</xsl:template>

<xsl:template match="/">
<html>
  <head>
    <title>ML-Macro Set</title>

    <style type="text/css">
@import "http://infinitesque.net/styles/main.css";
    </style>
  </head>
  <body>
    <h1 class="title">ML-Macro Set</h1>

    <xsl:apply-templates
      select="/*/preceding-sibling::comment()" mode="pre"/>

    <p>Assuming you are using "[[" as the left delimiter and "]]" as the right delimiter, refer to one of these macros as "[[macro-name]]". See <a href="http://infinitesque.net/articles/2006/doctype-xslt1/entities.xhtml">the ML-Macros description page</a> for details.</p>

    <table>
      <tr>
        <th class="title">Macro Name</th>
        <th class="title">Macro Value</th>
        <th class="title">Description</th>
      </tr>

      <xsl:apply-templates select="/ml:collection/ml:macro"/>
    </table>
  </body>
</html>
</xsl:template>

</xsl:stylesheet>
