diff options
author | Alex Merry <fdo-bugs@randomguy3.me.uk> | 2012-02-01 07:19:29 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-02-01 07:21:04 +0100 |
commit | fd333933a44b7984425721da47310ec9f5fb9aca (patch) | |
tree | 8b311b596b80155568f674425ced58d742b32ecd /secret-service/tools/spec-to-introspect.xsl | |
parent | c8bbc33a08c28a0580e7fc61fe31ce6af6f7c059 (diff) | |
download | xdg-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/tools/spec-to-introspect.xsl')
-rw-r--r-- | secret-service/tools/spec-to-introspect.xsl | 33 |
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, ' ', ''), '
', '')"/> - </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, ' ', ''), '
', '')"/> + </xsl:attribute> + </annotation> </xsl:for-each> <xsl:apply-templates/> </xsl:copy> |