forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreformat.xsl
More file actions
27 lines (23 loc) · 750 Bytes
/
reformat.xsl
File metadata and controls
27 lines (23 loc) · 750 Bytes
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/restnames">
<info name="{nameinfo/name}">
<xsl:attribute name="gender">
<xsl:choose>
<xsl:when test="nameinfo/male = 'true'">male</xsl:when>
<xsl:when test="nameinfo/female = 'true'">female</xsl:when>
</xsl:choose>
</xsl:attribute>
<countries>
<xsl:apply-templates select="//country"/>
</countries>
</info>
</xsl:template>
<xsl:template match="country[last()]">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="country">
<xsl:value-of select="."/><xsl:text>, </xsl:text>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>