<?xml-stylesheet href="http://www.w3.org/StyleSheets/base.css" type="text/css"?><?xml-stylesheet href="http://www.w3.org/2002/02/style-xsl.css" type="text/css"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" exclude-result-prefixes="html" xmlns:saxon="http://icl.com/saxon" extension-element-prefixes="saxon">

<!-- Output method XML -->
<xsl:output method="xml" 
  indent="yes"
  omit-xml-declaration="no" 
  encoding="utf-8"   />
 
<!-- Documenting the XSLT : fill the @@@-->
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="http://www.w3.org/StyleSheets/base"/>
    <title>XSLT extracting examples from the VoiceXML 2.1 spec</title>
  </head>
  <body>
    <div class='head'><a href="/"><img src="/Icons/w3c_home" alt="W3C"/></a></div>
    <p>This style sheet extracts the examples out of the <a href="http://www.w3.org/TR/2004/WD-voicexml21-20040323/">VoiceXML 2.1</a> spec (and other specs using the same mark up convention); it relies on the <code>saxon:output</code> extension.</p>


    <p class="copyright">Copyright &#169; 1994-2004 <a href="http://www.w3.org/">World Wide Web Consortium</a>, (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of
Technology">M.I.T.</acronym></a>, <a
href="http://www.ercim.org/"><acronym
title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
    Reserved. http://www.w3.org/Consortium/Legal/. W3C <a href="http://www.w3.org/Consortium/Legal/copyright-software">software licensing</a> rules apply.</p>
    <address><a href="http://www.w3.org/People/Dom/">Dominique Haza&#235;l-Massieux</a> - $Id: extract-examples.xsl,v 1.1 2004/07/21 12:01:34 dom Exp $</address>
    </body>
</html>

<xsl:template match="/">
  <xsl:for-each select="//html:div[@class='exampleInner'][starts-with(normalize-space(.),'&lt;?xml ')]">
    <saxon:output method='text'  omit-xml-declaration="yes" href="example-{format-number(position(),'00')}.xml">
      <xsl:value-of select="normalize-space(html:pre/text())"/>
    </saxon:output>
  </xsl:for-each>
</xsl:template>

  <!-- default: Identity Transformation -->
  <xsl:template match="*|@*|comment()|text()">
    <xsl:copy>
      <xsl:apply-templates select="*|@*|comment()|text()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>