summaryrefslogtreecommitdiffstats
path: root/secret-service
diff options
context:
space:
mode:
authorAlex Merry <fdo-bugs@randomguy3.me.uk>2012-02-01 07:19:29 +0100
committerStef Walter <stefw@gnome.org>2012-02-01 07:21:04 +0100
commitfd333933a44b7984425721da47310ec9f5fb9aca (patch)
tree8b311b596b80155568f674425ced58d742b32ecd /secret-service
parentc8bbc33a08c28a0580e7fc61fe31ce6af6f7c059 (diff)
downloadxdg-specs-fd333933a44b7984425721da47310ec9f5fb9aca.tar.xz
Add attributes before child elements
A bug appears to be because tp:type is transformed into child annotation element, but non-tp attributes are copied, and this is done in order the attributes appear. So if there are non-tp attributes after tp:type in an "arg" or "property" element, it will attempt to copy the attribute into the node having already added the "annotation" child element, and this is not allowed in XSLT. https://bugs.freedesktop.org/show_bug.cgi?id=45369
Diffstat (limited to 'secret-service')
-rw-r--r--secret-service/tools/spec-to-introspect.xsl33
1 files changed, 15 insertions, 18 deletions
diff --git a/secret-service/tools/spec-to-introspect.xsl b/secret-service/tools/spec-to-introspect.xsl
index ca8b4b6..2468237 100644
--- a/secret-service/tools/spec-to-introspect.xsl
+++ b/secret-service/tools/spec-to-introspect.xsl
@@ -61,24 +61,21 @@
<xsl:template match="arg|property">
<xsl:copy>
<xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="not(starts-with(name(), 'tp:'))">
- <xsl:copy/>
- </xsl:when>
- <xsl:when test="name() = 'tp:type'">
- <xsl:variable name="type">
- <xsl:call-template name="TpType">
- <xsl:with-param name="type" select="."/>
- </xsl:call-template>
- </xsl:variable>
- <annotation name="org.gtk.EggDBus.Type">
- <xsl:attribute name="value">
- <xsl:value-of select="translate(translate($type, ' ', ''), '&#xa;', '')"/>
- </xsl:attribute>
- </annotation>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
+ <xsl:if test="not(starts-with(name(), 'tp:'))">
+ <xsl:copy/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="@tp:type">
+ <xsl:variable name="type">
+ <xsl:call-template name="TpType">
+ <xsl:with-param name="type" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+ <annotation name="org.gtk.EggDBus.Type">
+ <xsl:attribute name="value">
+ <xsl:value-of select="translate(translate($type, ' ', ''), '&#xa;', '')"/>
+ </xsl:attribute>
+ </annotation>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:copy>