summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOlli Salli <olli.salli@collabora.co.uk>2008-08-24 21:52:35 +0300
committerMarc-André Lureau <marcandre.lureau@gmail.com>2009-02-13 00:01:44 +0200
commitd91bd31a878b5787f440624236fba2ee530bb39a (patch)
tree2178cee65bbe28468a12b7868d094bdc0c934780 /tools
parentbe568432789bccedc1736fe80e5c910ef7cbdad9 (diff)
Add check for array-name being present if an array of a complex type is used
Diffstat (limited to 'tools')
-rw-r--r--tools/doc-generator.xsl39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl
index 8f1f772..7761453 100644
--- a/tools/doc-generator.xsl
+++ b/tools/doc-generator.xsl
@@ -855,10 +855,49 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</xsl:message>
</xsl:if>
+ <xsl:if test="contains($tp-type, '[]')">
+ <xsl:call-template name="tp-type-array-usage-check">
+ <xsl:with-param name="single-type" select="$single-type"/>
+ <xsl:with-param name="type-of-tp-type" select="$type-of-tp-type"/>
+ </xsl:call-template>
+ </xsl:if>
+
<a href="#type-{$single-type}"><xsl:value-of select="$tp-type"/></a>
</xsl:template>
+ <xsl:template name="tp-type-array-usage-check">
+ <xsl:param name="single-type"/>
+ <xsl:param name="type-of-tp-type"/>
+
+ <xsl:variable name="array-name">
+ <xsl:choose>
+ <xsl:when test="//tp:struct[@name=$single-type]">
+ <xsl:value-of select="//tp:struct[@name=$single-type]/@array-name"/>
+ </xsl:when>
+ <xsl:when test="//tp:mapping[@name=$single-type]">
+ <xsl:value-of select="//tp:mapping[@name=$single-type]/@array-name"/>
+ </xsl:when>
+ <xsl:when test="//tp:external-type[@name=$single-type]">
+ <xsl:value-of select="//tp:external-type[@name=$single-type]/@array-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:if test="not(contains('ybnqiuxtdsvog', $type-of-tp-type))">
+ <xsl:if test="not($array-name) or $array-name=''">
+ <xsl:message terminate="yes">
+ <xsl:text>No array-name specified for complex type </xsl:text>
+ <xsl:value-of select="$single-type"/>
+ <xsl:text>, but array used&#10;</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
<xsl:template name="parenthesized-tp-type">
<xsl:if test="@tp:type">
<xsl:text> (</xsl:text>