swh:1:snp:ed2d467953071803b0382cac92a7b1b452fbb8ef
Tip revision: 691da6cd35cfb6843c5c531054281441f9c74a82 authored by Martin Holmes on 02 February 2012, 18:19:59 UTC
Tagging the 2.0.2 release of P5.
Tagging the 2.0.2 release of P5.
Tip revision: 691da6c
prevalidator.xsl
<xsl:stylesheet version="1.0"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:teix="http://www.tei-c.org/ns/Examples"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:XSL="http://www.w3.org/1999/xsl/TransformAlias" >
<!-- make list of attributes of which refer to data.pointer,
so that we can check them -->
<xsl:namespace-alias stylesheet-prefix="XSL" result-prefix="xsl"/>
<xsl:output indent="yes"/>
<xsl:key name="MEMBERS"
match="tei:elementSpec"
use="tei:classes/tei:memberOf/@key"/>
<xsl:key name="POINTERLIST"
match="tei:datatype/rng:ref[@name='data.pointer']"
use="'1'"/>
<xsl:template match="tei:TEI">
<XSL:stylesheet
version="1.0"
xmlns:teix="http://www.tei-c.org/ns/Examples"
xmlns:tei="http://www.tei-c.org/ns/1.0">
<xsl:for-each select="key('POINTERLIST',1)">
<xsl:variable name="a" select="ancestor::tei:attDef/@ident"/>
<xsl:variable name="e"
select="ancestor::tei:elementSpec/@ident"/>
<xsl:variable name="c"
select="ancestor::tei:classSpec/@ident"/>
<xsl:if test="not(starts-with($a,'xml'))">
<xsl:choose>
<xsl:when test="$e">
<XSL:template match="tei:{$e}/@{$a}">
<XSL:call-template name="checklinks">
<XSL:with-param name="stuff" select="normalize-space(.)"/>
</XSL:call-template>
</XSL:template>
<XSL:template match="teix:{$e}/@{$a}">
<XSL:call-template name="checkexamplelinks">
<XSL:with-param name="stuff" select="normalize-space(.)"/>
</XSL:call-template>
</XSL:template>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="key('MEMBERS',$c)">
<XSL:template match="tei:{@ident}/@{$a}">
<XSL:call-template name="checklinks">
<XSL:with-param name="stuff" select="normalize-space(.)"/>
</XSL:call-template>
</XSL:template>
<XSL:template match="teix:{@ident}/@{$a}">
<XSL:call-template name="checkexamplelinks">
<XSL:with-param name="stuff" select="normalize-space(.)"/>
</XSL:call-template>
</XSL:template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</XSL:stylesheet>
</xsl:template>
</xsl:stylesheet>