-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgetProperties.xsl
36 lines (30 loc) · 1023 Bytes
/
getProperties.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
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/properties">
<!-- Package meta info -->
<xsl:apply-templates select="entry[@key = 'pkg-id']"/>
<xsl:apply-templates select="entry[@key = 'pkg-description']"/>
<!-- Element meta info -->
<xsl:apply-templates select="entry[@key = 'id']"/>
<xsl:apply-templates select="entry[@key = 'type']"/>
</xsl:template>
<xsl:template match="entry">
<xsl:text>entry.</xsl:text>
<xsl:value-of select="@key"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="/categories">
<xsl:text>element.category = </xsl:text>
<xsl:variable name="path">
<xsl:for-each select="category">
<xsl:value-of select="name"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$path"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>