grim/gir-tools

24bd9dad8f11
Use a better test for micro versions that QuLogic came up with
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:gir="http://www.gtk.org/introspection/core/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0"
version="1.0"
>
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="newline" select="'&#10;'"/>
<xsl:variable name="tab" select="'&#9;'"/>
<xsl:variable name="newline-tab">
<xsl:value-of select="$newline"/>
<xsl:value-of select="$tab"/>
</xsl:variable>
<!-- ignore all the cdata in doc tags -->
<xsl:template match="gir:doc"/>
<xsl:template name="check-item">
<xsl:param name="node"/>
<xsl:param name="prefix"/>
<xsl:choose>
<xsl:when test="not(@version)">
<xsl:value-of select="concat($prefix, ' missing version', $newline)"/>
</xsl:when>
<xsl:when test="contains(substring-after(@version, '.'), '.')">
<xsl:value-of select="concat($prefix, ' version includes micro version &quot;', @version, '&quot;', $newline)"/>
</xsl:when>
</xsl:choose>
<xsl:if test="not(gir:doc)">
<xsl:value-of select="concat($prefix, ' missing documentation', $newline)"/>
</xsl:if>
<xsl:if test="contains(substring-after(@deprecated-version, '.'), '.')">
<xsl:value-of select="concat($prefix, ' deprecated-version includes micro version &quot;', @deprecated-version, '&quot;', $newline)"/>
</xsl:if>
</xsl:template>
<xsl:template match="gir:property">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('property ', ../@name, ':', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:method">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('method ', ../@name, '.', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:virtual-method">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('virtual method ', ../@name, '.', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:function">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('function ', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:function-macro">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('function macro ', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:constructor">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('constructor ', ../@name, '.', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:namespace/gir:callback">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('callback ', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="glib:signal">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('signal ', ../@name, ':', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:class">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('class ', @name)"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="gir:enumeration">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('enumeration ', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:bitfield">
<xsl:call-template name="check-item">
<xsl:with-param name="node" select="node()"/>
<xsl:with-param name="prefix" select="concat('bitfield ', @name)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="gir:namespace">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="gir:repository">
<xsl:apply-templates select="gir:namespace"/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="gir:repository"/>
</xsl:template>
</xsl:stylesheet>