--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ version="1.0">
+
+ <xsl:template match="/">
+ <xsl:element name="result">
+ <xsl:choose>
+ <xsl:when test="count(//xhtml:h1[contains(text(), 'Error')]) = 1">
+ <xsl:choose>
+ <xsl:when test="count(//xhtml:body/text()[contains(., 'already in the')]) =
+ 1">
+ <xsl:text>duplicate</xsl:text>
+ </xsl:when>
+ <xsl:when test="count(//xhtml:body/text()[contains(., 'conflicts with a
+ recording')]) =
+ 1">
+ <xsl:text>conflict</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ error
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>ok</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="xhtml:body">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template match="text()">
+ TEXT NODE
+ <xsl:value-of select="."/>
+ </xsl:template>
+</xsl:stylesheet>