<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: aboutTests.xsl,v 1.1 2007/03/27 22:20:28 jean-gui Exp $ -->
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:s="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:h="http://www.w3.org/1999/xhtml"
  xmlns:t="http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#"
  xmlns:g="http://www.w3.org/TR/grddl-tests/grddl-test-vocabulary.rdf#"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  exclude-result-prefixes="xlink"
  version="1.0">

<xsl:output method="xml" indent="yes"/>

<div xmlns="http://www.w3.org/1999/xhtml">
<address>$Id: aboutTests.xsl,v 1.1 2007/03/27 22:20:28 jean-gui Exp $</address>
</div>

<xsl:template match="/">
  <r:RDF xml:base="http://www.w3.org/2001/sw/grddl-wg/td/">
    <xsl:apply-templates />
  </r:RDF>
</xsl:template>

<xsl:template match='h:ul[@class="TestList"]/h:li'>
  <xsl:element name="t:Test" namespace="http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#">
    <xsl:choose>
      <xsl:when test="@class = 'NetworkedTest'">
        <xsl:attribute name="r:about">http://www.w3.org/TR/grddl-tests/#<xsl:value-of select="@id"/></xsl:attribute>    
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="r:about">#<xsl:value-of select="@id"/></xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="@class = 'NetworkedTest'">
      <r:type r:resource="http://www.w3.org/TR/grddl-tests/grddl-test-vocabulary.rdf#NetworkedTest"/>
    </xsl:if>
    <dc:title><xsl:value-of select="h:b" /></dc:title>
    <t:inputDocument r:resource='{.//h:a[text()="input"]/@href}' />
    <t:outputDocument r:resource='{.//h:a[text()="output"]/@href}' />
    <xsl:apply-templates select=".//g:*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="g:*[@xlink:href]">
  <xsl:element name="g:{local-name()}">
    <xsl:attribute name="r:resource"
      ><xsl:value-of select="@xlink:href"/></xsl:attribute>
  </xsl:element>
</xsl:template>

<!-- don't pass text  thru -->
<xsl:template match="text()|@*">
</xsl:template>

</xsl:stylesheet>
