Print

Print


Hi Stuart,

 > Is anyone doing anything useful in the way of validating that the CSS in
 > their TEI attributes is a well formed CSS fragment?

I have this tiny XSLT stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="2.0"
   xmlns:xi="http://www.w3.org/2001/XInclude"
     xpath-default-namespace="http://www.tei-c.org/ns/1.0"
     xmlns:exist="http://exist.sourceforge.net/NS/exist"
     exclude-result-prefixes="#all">

   <xsl:output method="text" encoding="UTF-8" media-type="text/css" />

   <xsl:template match="/">
     <xsl:for-each select="//@rend">
       <xsl:text>
.style_</xsl:text><xsl:value-of select="position()" />
       <xsl:text>{
</xsl:text>
       <xsl:value-of select="."/>
<xsl:text>
}

</xsl:text>
     </xsl:for-each>

   </xsl:template>
</xsl:stylesheet>


which runs as part of a Cocoon pipeline against any of my documents, to 
produce (for instance) this:

<http://mariage.uvic.ca/xml.css?id=advis_aux_hommes_martyrisez>

which I can pass to the Jigsaw validator like this:

<http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fmariage.uvic.ca%2Fxml.css%3Fid%3Dadvis_aux_hommes_martyrisez>

It would be relatively easy to make it output more information about 
each particular class (its parent element, containing document id, etc.).

Cheers,
Martin

stuart yeates wrote:
> Sebastian Rahtz wrote:
>> Martin Holmes wrote:
>>> It's very
>>> good for what it's intended for
>> agreed. I am very pleased we have it.
> 
> On a related note:
> 
> Is anyone doing anything useful in the way of validating that the CSS in 
> their TEI attributes is a well formed CSS fragment?
> 
> cheers
> stuart

-- 
Martin Holmes
University of Victoria Humanities Computing and Media Centre
([log in to unmask])
Half-Baked Software, Inc.
([log in to unmask])
[log in to unmask]