<?xml version="1.0" encoding="US-ASCII"?>
<!--
	XSL1.0 Transformation from (RSS0.91, RSS1.0, RSS2.0) to XHTML+VoiceXML2.0
-->
<xsl:stylesheet
 version="1.0"
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:ev="http://www.w3.org/2001/xml-events"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:rss="http://purl.org/rss/1.0/"
 xmlns:vxml="http://www.w3.org/2001/vxml"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xv="http://www.voicexml.org/2002/xhtml+voice"
 exclude-result-prefixes="rdf rss"
 xml:lang="en-US">

<xsl:output
 doctype-public="-//VoiceXML Forum//DTD XHTML+Voice 1.2//EN"
 doctype-system="http://www.voicexml.org/specs/multimodal/x+v/12/dtd/xhtml+voice12.dtd"
 encoding="US-ASCII"
 indent="yes"
 media-type="application/xhtml+voice+xml"
 method="xml"
 omit-xml-declaration="no"
 version="1.0"/>

<xsl:template match="/">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <xsl:apply-templates select="/rss/channel"/><!-- RSS 0.91 --><!-- RSS 2.0 -->
  <xsl:apply-templates select="/rdf:RDF/rss:channel"/><!-- RSS 1.0 -->
 </html>
</xsl:template>

<!-- RSS 0.91 -->
<xsl:template match="/rss/channel">
 <head>
  <meta http-equiv="Content-Type" content="application/xhtml+voice+xml; charset=US-ASCII"/>
  <meta http-equiv="Content-Script-Type" content="text/javascript"/>
  <meta http-equiv="Content-Language" content="en"/>
  <title>RSS XHTML+VoiceXML - Alexandre Alapetite: <xsl:value-of select="title"/></title>
  <meta>
   <xsl:attribute name="name">description</xsl:attribute>
   <xsl:attribute name="content">Demonstration of X+V by Alexandre Alapetite: <xsl:value-of select="title"/></xsl:attribute>
  </meta>
  <meta name="language" content="en"/>
  <meta name="robots" content="none"/>
  <meta>
   <xsl:attribute name="name">description</xsl:attribute>
   <xsl:attribute name="content">
    <xsl:value-of select="description"/>
   </xsl:attribute>
  </meta>
  <link rel="author" href="../../cv/alexandre-alapetite.en.html" xml:lang="fr-FR" title="Alexandre Alapetite" />
  <link rel="start" href="../../index.en.html" />
  <link rel="up" href="index.php"/>
  <link rel="stylesheet" type="text/css" href="mxml.css" title="Normal"/>

  <vxml:form id="titles">
   <vxml:block>
    <xsl:for-each select="item">
     <vxml:prompt>
      <xsl:attribute name="xv:src">#h2_<xsl:number count="item"/></xsl:attribute>
     </vxml:prompt>
     <vxml:prompt>
      <xsl:attribute name="xv:src">#p_<xsl:number count="item"/></xsl:attribute>
     </vxml:prompt>
    </xsl:for-each>
   </vxml:block>
  </vxml:form>
 </head>

 <body>
  <xsl:attribute name="ev:event">load</xsl:attribute>
  <xsl:attribute name="ev:handler">#titles</xsl:attribute>
  <div id="logo"><img src="risoe-logo.png" width="165" height="83" alt="[Risoe logo]" title="Logo for Risoe National Laboratory" /></div>
  <address id="credits">By <a href="../../cv/alexandre-alapetite.en.html">Alexandre Alapetite</a> on 2004-11-05</address>

  <h1>RSS news with XHTML+VoiceXML:<br /><xsl:value-of select="title"/></h1>
  <p>
   The following example only works with a <abbr title="XHTML+VoiceXML">X+V</abbr> voice-enabled browser.
   If needed, you can <a href="http://www.opera.com/support/tutorials/voice/using/" class="blank" rel="help">get some help for the Opera browser</a>.
  </p>
  <ul>
   <li>A <a href="video/news-xhtml-voicexml.avi" type="video/avi">video is provided</a> - <span class="small">(format: <a href="http://www.xvid.org" class="blank">XviD</a>, <a href="http://sourceforge.net/projects/lame/" class="blank"><abbr>MP3</abbr></a> 2.86MB)</span>.</li>
  </ul>
   <xsl:apply-templates select="item"/>
  <ul>
   <li><a href="index.php">Back</a></li>
  </ul>
 </body>
</xsl:template>

<xsl:template match="/rss/channel/item">
 <h2>
  <xsl:attribute name="id">h2_<xsl:number count="item"/></xsl:attribute>
  <xsl:value-of select="title"/>.
 </h2>
 <p>
  <xsl:attribute name="id">p_<xsl:number count="item"/></xsl:attribute>
  <xsl:value-of select="description"/>
  <span class="small"> <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>...</a></span>
 </p>
</xsl:template>
<!-- /RSS 0.91 -->

<!-- RSS 1.0 -->
<xsl:template match="/rdf:RDF/rss:channel">
 <head>
  <meta http-equiv="Content-Type" content="application/xhtml+voice+xml; charset=US-ASCII"/>
  <meta http-equiv="Content-Script-Type" content="text/javascript"/>
  <meta http-equiv="Content-Language" content="en"/>
  <title>RSS XHTML+VoiceXML Alexandre Alapetite: <xsl:value-of select="rss:title"/></title>
  <meta>
   <xsl:attribute name="name">description</xsl:attribute>
   <xsl:attribute name="content">Demonstration of X+V by Alexandre Alapetite: <xsl:value-of select="title"/></xsl:attribute>
  </meta>
  <meta name="language" content="en"/>
  <meta name="robots" content="none"/>
  <meta>
   <xsl:attribute name="name">description</xsl:attribute>
   <xsl:attribute name="content">
    <xsl:value-of select="rss:description"/>
   </xsl:attribute>
  </meta>
  <link rel="author" href="../../cv/alexandre-alapetite.en.html" xml:lang="fr-FR" title="Alexandre Alapetite" />
  <link rel="start" href="../../index.en.html" />
  <link rel="up" href="index.php"/>
  <link rel="stylesheet" type="text/css" href="mxml.css" title="Normal"/>

  <vxml:form id="titles">
   <vxml:block>
    <xsl:apply-templates select="rss:items/rdf:Seq" mode="header"/>
   </vxml:block>
  </vxml:form>
 </head>

 <body>
  <xsl:attribute name="ev:event">load</xsl:attribute>
  <xsl:attribute name="ev:handler">#titles</xsl:attribute>
  <div id="logo"><img src="risoe-logo.png" width="165" height="83" alt="[Risoe logo]" title="Logo for Risoe National Laboratory" /></div>
  <address id="credits">By <a href="../../cv/alexandre-alapetite.en.html">Alexandre Alapetite</a> on 2004-11-05, updated on 2006-01-23</address>

  <h1>RSS news with XHTML+VoiceXML:<br /><xsl:value-of select="rss:title"/></h1>
  <p>
   The following example only works with a <abbr title="XHTML+VoiceXML">X+V</abbr> voice-enabled browser.
   If needed, you can <a href="http://www.opera.com/support/tutorials/voice/using/" class="blank" rel="help">get some help for the Opera browser</a>.
  </p>
  <ul>
   <li>A <a href="video/news-xhtml-voicexml.avi" type="video/avi">video is provided</a> - <span class="small">(format: <a href="http://www.xvid.org" class="blank">XviD</a>, <a href="http://sourceforge.net/projects/lame/" class="blank"><abbr>MP3</abbr></a> 2.86MB)</span>.</li>
  </ul>
   <xsl:apply-templates select="rss:items/rdf:Seq" mode="body"/>
  <ul>
   <li><a href="index.php">Back</a></li>
  </ul>
 </body>
</xsl:template>

<xsl:template match="/rdf:RDF/rss:channel/rss:items/rdf:Seq" mode="header">
 <xsl:for-each select="rdf:li">
  <xsl:variable name="rdfr" select="@rdf:resource"/>
  <xsl:apply-templates select="/rdf:RDF/rss:item[@rdf:about=$rdfr]" mode="header"/>
 </xsl:for-each>
</xsl:template>

<xsl:template match="/rdf:RDF/rss:item" mode="header">
 <vxml:prompt>
  <xsl:attribute name="xv:src">#h2_<xsl:number count="rss:item"/></xsl:attribute>
 </vxml:prompt>
 <vxml:prompt>
  <xsl:attribute name="xv:src">#p_<xsl:number count="rss:item"/></xsl:attribute>
 </vxml:prompt>
</xsl:template>

<xsl:template match="/rdf:RDF/rss:channel/rss:items/rdf:Seq" mode="body">
 <xsl:for-each select="rdf:li">
  <xsl:variable name="rdfr" select="@rdf:resource"/>
  <xsl:apply-templates select="/rdf:RDF/rss:item[@rdf:about=$rdfr]" mode="body"/>
 </xsl:for-each>
</xsl:template>

<xsl:template match="/rdf:RDF/rss:item" mode="body">
 <h2>
  <xsl:attribute name="id">h2_<xsl:number count="rss:item"/></xsl:attribute>
  <xsl:value-of select="rss:title"/>.
 </h2>
 <p>
  <xsl:attribute name="id">p_<xsl:number count="rss:item"/></xsl:attribute>
  <xsl:value-of select="rss:description"/>
  <span class="small"> <a><xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>...</a></span>
 </p>
</xsl:template>
<!-- /RSS 1.0 -->

</xsl:stylesheet>
