-
Notifications
You must be signed in to change notification settings - Fork 4
/
virginia.xsl
executable file
·97 lines (69 loc) · 2.47 KB
/
virginia.xsl
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
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:orig="http://StatRev.xsd"
xmlns:fn="http://localhost/" xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<!-- Strip whitespace from everything. -->
<xsl:strip-space elements="*" />
<!-- Don't include any whitespace-only text nodes. -->
<xsl:strip-space elements="*" />
<xsl:template match="/">
<!-- Iterate through every section -->
<xsl:for-each select="section">
<xsl:result-document href="section/{desig}.xml">
<xsl:apply-templates select="section"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
<!--Start processing at the section element.-->
<xsl:template match="section">
<law>
<structure>
<xsl:apply-templates select="structure"/>
</structure>
<section_number>
<xsl:value-of select="desig"/>
</section_number>
<catch_line><xsl:value-of select="head" /></catch_line>
<text>
<xsl:for-each select="para">
<xsl:value-of select="."/>
</xsl:for-each>
</text>
<history>
<xsl:value-of select="history"/>
</history>
</law>
</xsl:template>
<xsl:template match="structure">
<xsl:apply-templates select="hierarchy[@label='title']" />
<xsl:apply-templates select="hierarchy[@label='subtitle']" />
<xsl:apply-templates select="hierarchy[@label='part']" />
<xsl:apply-templates select="hierarchy[@label='chapter']" />
<xsl:apply-templates select="hierarchy[@label='subpart']" />
<xsl:apply-templates select="hierarchy[@label='article']" />
</xsl:template>
<xsl:template match="hierarchy[@label='title']">
<unit label="title" identifier="$TitleIdentifier" level="1">
<xsl:value-of select="@head"/>
</unit>
</xsl:template>
<xsl:template match="hierarchy[@label='subtitle']">
<unit label="subtitle" identifier="$SubtitleIdentifier" level="2">
<xsl:value-of select="@head"/>
</unit>
</xsl:template>
<xsl:template match="hierarchy[@label='part']">
<unit label="part" identifier="$PartIdentifier" level="3">
<xsl:value-of select="@head"/>
</unit>
</xsl:template>
<xsl:template match="hierarchy[@label='chapter']">
<unit label="chapter" identifier="$ChapterIdentifier" level="4">
<xsl:value-of select="@head"/>
</unit>
</xsl:template>
<xsl:template match="hierarchy[@label='article']">
<unit label="article" identifier="$ArticleIdentifier" level="5">
<xsl:value-of select="@head"/>
</unit>
</xsl:template>
</xsl:stylesheet>