https://github.com/TEIC/TEI
Tip revision: 6f86eb3006d815bb183e0d0d8f94a9b3357d38a4 authored by Syd Bauman on 10 September 2014, 03:37:43 UTC
Tag this version which has Schematron code in biblStruct.xml for deprecating <idno> as a direct child of <biblStruct>. I can't implement this for the upcoming release, as we have 29 cases of biblStruct/idno in P5's own bibliogrraphy.
Tag this version which has Schematron code in biblStruct.xml for deprecating <idno> as a direct child of <biblStruct>. I can't implement this for the upcoming release, as we have 29 cases of biblStruct/idno in P5's own bibliogrraphy.
Tip revision: 6f86eb3
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>