spec: Allow <annotation> in <arg> elements in introspection XML

This is widely used in practice (especially by GLib — just look at files
in /usr/share/dbus-1/interfaces/), and there is no reason not to allow
it. Update the specification, introspection DTD and XSL file to allow
and represent it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86162
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Philip Withnall 2016-10-01 13:47:27 +02:00 committed by Simon McVittie
parent 699fbe8df6
commit f354940111
3 changed files with 8 additions and 2 deletions

View file

@ -4045,7 +4045,7 @@
</itemizedlist>
</para>
<para>
Method, interface, property, and signal elements may have
Method, interface, property, signal, and argument elements may have
"annotations", which are generic key/value pairs of metadata.
They are similar conceptually to Java's annotations and C# attributes.
Well-known annotations:

View file

@ -16,7 +16,7 @@
<!ELEMENT signal (arg|annotation)*>
<!ATTLIST signal name CDATA #REQUIRED>
<!ELEMENT arg EMPTY>
<!ELEMENT arg (annotation)*>
<!ATTLIST arg name CDATA #IMPLIED>
<!ATTLIST arg type CDATA #REQUIRED>
<!-- Method arguments SHOULD include "direction",

View file

@ -80,6 +80,12 @@
<span class="type"><xsl:value-of select="@type"/></span><xsl:text> </xsl:text>
<span class="symbol"><xsl:value-of select="@name"/></span><xsl:text> </xsl:text>
<xsl:if test="annotation">
<ul>
<xsl:apply-templates select="annotation"/>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>