[Schematron] svrl to html, iso-schematron

Ganesh Babu N nbabuganesh at gmail.com
Tue Oct 26 00:15:03 EDT 2010


Dear Rick,

Here is the XSLT from viewing the SVRL xml output in Browser.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:sch="http://www.ascc.net/xml/schematron"
               xmlns:iso="http://purl.oclc.org/dsdl/schematron"
               xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
                               version="1.0">
                               <xsl:output method="html" indent="yes"/>

                               <xsl:template match="/">
<html>
<head><title><xsl:value-of select="//svrl:text"/></title></head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="svrl:text"><h2
align="center"><xsl:apply-templates/></h2></xsl:template>
<xsl:template match="svrl:text[2]"><h3 align="left"><font
color="magenta"><xsl:value-of select="substring-after(.,
'/')"/></font></h3></xsl:template>

<xsl:template match="svrl:failed-assert">
<xsl:choose>
<xsl:when test="@flag = 'fatal'">
<p><font color="red"><font color="green"><xsl:value-of
select="@line"/>-<xsl:value-of select="@column"/>: </font>ERROR:
<xsl:value-of select="svrl:text"/></font></p>
</xsl:when>
<xsl:when test="@flag = 'warning'">
<p><font color="blue"><font color="green"><xsl:value-of
select="@line"/>-<xsl:value-of select="@column"/>: </font>Warning:
<xsl:value-of select="svrl:text"/></font></p>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Regards,
Ganesh


On Mon, Oct 25, 2010 at 6:25 PM,  <rjelliffe at allette.com.au> wrote:
> Attached is some code I have been using.
>
> Also my latest blog has a different kind of SVRL stylesheet, to generate
> coverage reports.
>  http://broadcast.oreilly.com/2010/10/schema-coverage.html
>
> Cheers
> Rick
> _______________________________________________
> Schematron mailing list
> Schematron at eccnet.com
> http://www.eccnet.com/mailman/listinfo/schematron
>
>



More information about the Schematron mailing list