diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-07-01 12:50:33 +0000 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-02-13 00:01:43 +0200 |
commit | b9438ea91342a3e958cfc1d376cc6f58013a327d (patch) | |
tree | 06b4d2c9958aba669ee4cd0a4093de78268ecb10 /tools | |
parent | 33370690a9a65cbb18f5225557e970b403e2ade5 (diff) |
doc-generator.xsl: tp:member-ref: document, add sanity checking
Diffstat (limited to 'tools')
-rw-r--r-- | tools/doc-generator.xsl | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl index d55dac3..c202af4 100644 --- a/tools/doc-generator.xsl +++ b/tools/doc-generator.xsl @@ -75,12 +75,36 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA </a> </xsl:template> + <!-- tp:member-ref: reference a property of the current interface --> <xsl:template match="tp:member-ref" mode="html"> <xsl:variable name="prefix" select="concat(ancestor::interface/@name, '.')"/> + <xsl:variable name="name" select="string(.)"/> - <a xmlns="http://www.w3.org/1999/xhtml" href="#{$prefix}{string(.)}"> - <xsl:value-of select="string(.)"/> + <xsl:if test="not(ancestor::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: Cannot use tp:member-ref when not in an</xsl:text> + <xsl:text> <interface> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:choose> + <xsl:when test="ancestor::interface/signal[@name=$name]"/> + <xsl:when test="ancestor::interface/method[@name=$name]"/> + <xsl:when test="ancestor::interface/property[@name=$name]"/> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: interface </xsl:text> + <xsl:value-of select="ancestor::interface/@name"/> + <xsl:text> has no signal/method/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="#{$prefix}{$name}"> + <xsl:value-of select="$name"/> </a> </xsl:template> |