diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-07-01 12:50:01 +0000 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-02-13 00:01:43 +0200 |
commit | 33370690a9a65cbb18f5225557e970b403e2ade5 (patch) | |
tree | d289efb9c1999484fe08e44326929cc4df36ab51 /tools | |
parent | 8e31af3b586c6fb657272e281db66efb27211b7b (diff) |
doc-generator.xsl: document tp:dbus-ref, add sanity checking
Diffstat (limited to 'tools')
-rw-r--r-- | tools/doc-generator.xsl | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl index 0137174..d55dac3 100644 --- a/tools/doc-generator.xsl +++ b/tools/doc-generator.xsl @@ -39,16 +39,38 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA </xsl:call-template> </xsl:template> + <!-- tp:dbus-ref: reference a D-Bus interface, signal, method or property --> <xsl:template match="tp:dbus-ref" mode="html"> - <xsl:variable name="prefix"> + <xsl:variable name="name"> <xsl:choose> <xsl:when test="@namespace"> <xsl:value-of select="@namespace"/> <xsl:text>.</xsl:text> </xsl:when> </xsl:choose> + <xsl:value-of select="string(.)"/> </xsl:variable> - <a xmlns="http://www.w3.org/1999/xhtml" href="#{$prefix}{string(.)}"> + + <xsl:choose> + <xsl:when test="//interface[@name=$name]"/> + <xsl:when test="//interface/method[concat(../@name, '.', @name)=$name]"/> + <xsl:when test="//interface/signal[concat(../@name, '.', @name)=$name]"/> + <xsl:when test="//interface/property[concat(../@name, '.', @name)=$name]"/> + <xsl:when test="//interface[@name=concat($name, '.DRAFT')]"/> + <xsl:when test="//interface/method[concat(../@name, '.', @name)=concat($name, '.DRAFT')]"/> + <xsl:when test="//interface/signal[concat(../@name, '.', @name)=concat($name, '.DRAFT')]"/> + <xsl:when test="//interface/property[concat(../@name, '.', @name)=concat($name, '.DRAFT')]"/> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: cannot find D-Bus interface, method, signal</xsl:text> + <xsl:text> or property called '</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + + <a xmlns="http://www.w3.org/1999/xhtml" href="#{$name}"> <xsl:value-of select="string(.)"/> </a> </xsl:template> |