<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xhtml="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:pxt="http://sergiocarvalho.com/2008/PXT" 
                xmlns:bc="http://blog.com/2008/pxt"
                xmlns:mogul="http://sergiocarvalho.com/2008/Mogul">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
 <sql>
BEGIN;
DELETE FROM element WHERE version = 'html40';
<xsl:apply-templates select="/xhtml:html/xhtml:body/xhtml:table[1]/xhtml:tr/xhtml:td[1]/xhtml:a" />COMMIT;
 </sql>
</xsl:template>

<xsl:template match="xhtml:a">INSERT INTO element(version,name,url) VALUES('html40','<xsl:value-of select="text()" />', 'http://www.w3.org/TR/REC-html40/<xsl:value-of select="substring(@href,4)" />');
</xsl:template>

</xsl:stylesheet>

