-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathis-common.xsl
More file actions
50 lines (38 loc) · 1.59 KB
/
is-common.xsl
File metadata and controls
50 lines (38 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- =================================================================
Contains XSLT transforms common to the is-fo.xsl and is-html.xsl
stylesheets.
================================================================== -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ===== SELF-REFERENCES ================================================== -->
<xsl:template name="his">
<!-- Up to date with ISO/IEC Directives, part 2, 2004, 5th ed -->
<xsl:choose>
<xsl:when test="/document/head/part-number">
<xsl:text>his part of </xsl:text>
<xsl:value-of select="/document/head/organization"/>
<xsl:value-of select="/document/head/document-number"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>his International Standard</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="this" name="this">
<xsl:text>t</xsl:text>
<xsl:call-template name="his"/>
</xsl:template>
<xsl:template match="This">
<xsl:text>T</xsl:text>
<xsl:call-template name="his"/>
</xsl:template>
<!-- ===== VALIDATION OF NORMATIVE REFERENCES =============================== -->
<xsl:template name="verify-normative-references">
<xsl:for-each select="referenced-document">
<xsl:variable name="id" select="@id"/>
<xsl:if test="not(// clause // xref[@to = $id])">
<xsl:message>ERROR: Normative reference <xsl:value-of select="$id"/> not referenced</xsl:message>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>