-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxmlspec2is.xsl
More file actions
210 lines (173 loc) · 6.31 KB
/
xmlspec2is.xsl
File metadata and controls
210 lines (173 loc) · 6.31 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="spec">
<document>
<head>
<organization>ISO/IEC</organization>
<document-type>International Standard</document-type>
<stage>enquiry</stage>
<tc-number>1</tc-number>
<tc-name>Information Technology</tc-name>
<sc-number>34</sc-number>
<sc-name>Document Description and Processing Languages</sc-name>
<wg-number>1</wg-number>
<serial-number>0</serial-number>
<document-number>19757</document-number>
<part-number>11</part-number>
<document-language>E</document-language>
<secretariat>IPSJ/ITSCJ</secretariat>
<date>2010-09-10</date>
<!--
<previous-date>2005-07-20</previous-date>
<published-at>http://www.isotopicmaps.org/sam/sam-xtm/</published-at>
-->
<title>
<introductory>Information Technology</introductory>
<main>Document Schema Definition Languages (DSDL)</main>
<complementary>Schema Association</complementary>
</title>
<editor>Jirka Kosek</editor>
</head>
<!-- ===== FOREWORD ========================================================-->
<foreword>
<p><This/> is being jointly developed by W3C and ISO/IEC JTC1/SC34.
The technical content of this specification and that of <xref to="xml-model"/> is expected to be identical.</p>
<part-list>
<part><number>1</number><title>Overview</title></part>
<part><number>2</number><title>Grammar-based validation — RELAX NG</title></part>
<part><number>3</number><title>Rule-based validation — Schematron</title></part>
<part><number>4</number><title>Namespace-based validation dispatching language — NVDL</title></part>
<part><number>5</number><title>Extensible Datatypes</title></part>
<part><number>6</number><title>Path-based integrity constraints</title></part>
<part><number>7</number><title>Character repertoire description language — CREPDL</title></part>
<part><number>8</number><title>Document schema renaming language — DSRL</title></part>
<part><number>9</number><title>Datatype- and namespace-aware DTDs</title></part>
<part><number>10</number><title>Validation management</title></part>
<part><number>11</number><title>Schema Association</title></part>
</part-list>
</foreword>
<xsl:apply-templates/>
</document>
</xsl:template>
<xsl:template match="div1[@id='introduction']">
<introduction>
<xsl:apply-templates/>
</introduction>
<scope>
<xsl:apply-templates select="/spec/header/abstract/node()"/>
</scope>
<normative-references>
<xsl:apply-templates select="/spec/back/div1[@id='references']/blist/bibl"/>
</normative-references>
</xsl:template>
<xsl:template match="div1[@id='introduction']/head"/>
<xsl:template match="p">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="div1">
<clause><xsl:apply-templates/></clause>
</xsl:template>
<xsl:template match="inform-div1">
<annex normative="false"><xsl:apply-templates/></annex>
</xsl:template>
<xsl:template match="head">
<title><xsl:apply-templates/></title>
</xsl:template>
<xsl:template match="p[rfc2119[../bibref[@ref='rfc2119']]]">
<!-- Remove RFC lang para -->
</xsl:template>
<!-- must -> shall -->
<xsl:template match="text()">
<xsl:value-of select="replace(
replace(., '-level', ''), 'must', 'shall')"/>
</xsl:template>
<xsl:template match="rfc2119[following-sibling::node()[1][self::text()][starts-with(., '-level')]]"/>
<xsl:template match="bibref">
<xref to="{@ref}"/>
</xsl:template>
<xsl:template match="bibl">
<referenced-document id="{@id}">
<xsl:if test="@key ne ''">
<abbrev><xsl:value-of select="@key"/></abbrev>
</xsl:if>
<xsl:apply-templates mode="bibl"/>
<xsl:if test="@href ne ''">
<url><xsl:value-of select="@href"/></url>
</xsl:if>
</referenced-document>
<xsl:if test="not(following-sibling::bibl)">
<referenced-document id="xml-model">
<abbrev>XML-MODEL</abbrev>
<title>Associating Schemas with XML documents 1.0 (First Edition), </title>
<field>P. Grosso, </field>
<field>J. Kosek. </field>
<field>W3C, April 2010.</field>
<url>http://www.w3.org/TR/xml-model/</url>
</referenced-document>
</xsl:if>
</xsl:template>
<xsl:template match="titleref" mode="bibl">
<title><xsl:apply-templates mode="bibl"/></title>
</xsl:template>
<xsl:template match="text()" mode="bibl">
<field><xsl:value-of select="."/></field>
</xsl:template>
<xsl:template match="gitem">
<constraint>
<xsl:apply-templates/>
</constraint>
</xsl:template>
<xsl:template match="gitem/label">
<title>
<xsl:apply-templates/>
</title>
</xsl:template>
<xsl:template match="back/div1">
<!-- Ignore list of references -->
</xsl:template>
<xsl:template match="code">
<code><xsl:apply-templates/></code>
</xsl:template>
<xsl:template match="emph">
<em><xsl:apply-templates/></em>
</xsl:template>
<xsl:template match="termdef|term">
<xsl:copy><xsl:apply-templates/></xsl:copy>
</xsl:template>
<xsl:template match="xtermref">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match="prodgroup">
<prodlist><xsl:apply-templates/></prodlist>
</xsl:template>
<xsl:template match="prod">
<prod><xsl:apply-templates/></prod>
</xsl:template>
<xsl:template match="lhs|rhs">
<grp><xsl:apply-templates/></grp>
</xsl:template>
<xsl:template match="xnt">
<nt><xsl:apply-templates/></nt>
</xsl:template>
<xsl:template match="olist">
<ol><xsl:apply-templates/></ol>
</xsl:template>
<xsl:template match="olist/item">
<li><xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="example">
<example><xsl:apply-templates/></example>
</xsl:template>
<xsl:template match="example/head">
<p><i><xsl:apply-templates/></i></p>
</xsl:template>
<xsl:template match="eg">
<pre><xsl:value-of select="replace(., '

', '
')"/></pre>
</xsl:template>
<xsl:template match="table">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="ednote|authlist|status|abstract|langusage|revisiondesc|scrap/head"/>
</xsl:stylesheet>