1 | <?xml version="1.0"?>
|
---|
2 | <xsl:stylesheet xmlns:g="http://geni.net/schema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
---|
3 | <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
|
---|
4 | <xsl:strip-space elements="*" />
|
---|
5 |
|
---|
6 |
|
---|
7 | <!-- root element -->
|
---|
8 | <xsl:template match="/*" priority="1">
|
---|
9 | <metadata>
|
---|
10 | <xsl:apply-templates>
|
---|
11 | <xsl:with-param name="path" select="name()"/>
|
---|
12 | </xsl:apply-templates>
|
---|
13 | </metadata>
|
---|
14 | </xsl:template>
|
---|
15 |
|
---|
16 |
|
---|
17 | <!-- non leaf node -->
|
---|
18 | <xsl:template match="*[*]">
|
---|
19 | <xsl:param name="path"/>
|
---|
20 | <xsl:apply-templates>
|
---|
21 | <xsl:with-param name="path" select="concat($path,'_',name())"/>
|
---|
22 | </xsl:apply-templates>
|
---|
23 | </xsl:template>
|
---|
24 |
|
---|
25 |
|
---|
26 | <!-- leaf node -->
|
---|
27 | <xsl:template match="*[not(*)]">
|
---|
28 | <xsl:param name="path"/>
|
---|
29 | <xsl:element name="AVU">
|
---|
30 | <xsl:element name="Attribute">
|
---|
31 | <xsl:value-of select="concat($path,'_',name())"/>
|
---|
32 | </xsl:element>
|
---|
33 | <xsl:element name="Value">
|
---|
34 | <xsl:apply-templates/>
|
---|
35 | </xsl:element>
|
---|
36 | </xsl:element>
|
---|
37 | </xsl:template>
|
---|
38 |
|
---|
39 |
|
---|
40 | </xsl:stylesheet> |
---|