-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaeonLike_3_Sort.xsl
60 lines (54 loc) · 1.88 KB
/
aeonLike_3_Sort.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
encoding="UTF-8" media-type="text/xml; charset=UTF-8"
omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="collections">
<xsl:result-document method="xml" href="aeonLike_c_Sorted.xml">
<records>
<!-- Sort on Collections -->
<collection_records>
<xsl:for-each-group select="aeonLikeCollections" group-by="CallNumber">
<collection>
<call>
<xsl:value-of select="CallNumber"/>
</call>
<users>
<xsl:for-each select="current-group()">
<username>
<xsl:value-of select="Username"/>
</username>
</xsl:for-each>
</users>
</collection>
</xsl:for-each-group>
</collection_records>
<!-- Sort on Users -->
<user_records>
<xsl:for-each-group select="aeonLikeCollections" group-by="Username">
<user>
<username>
<xsl:value-of select="Username"/>
</username>
<xsl:for-each select="current-group()">
<callnumber>
<xsl:value-of select="CallNumber"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="finallocation"/>
</callnumber>
<url>
<xsl:value-of select="CallNumber"/>
</url>
<count>
<xsl:value-of select="count"/>
</count>
</xsl:for-each>
</user>
</xsl:for-each-group>
</user_records>
</records>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>