2 <!-- This stylesheet is used to check that symbols exported
3 from libxml2-api.xml are also present in the symbol file
4 symbols.xml which is used to generate libxml2.syms setting
5 up the allowed access point to the shared libraries -->
8 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 <xsl:output method="text" encoding="UTF-8"/>
12 <xsl:variable name="syms" select="document('symbols.xml')"/>
14 <xsl:template match="/">
15 <xsl:message terminate="no">
16 <xsl:text>Looking for functions in symbols.xml</xsl:text>
18 <xsl:apply-templates select="/api/symbols/function"/>
19 <xsl:message terminate="no">
20 <xsl:text>Found </xsl:text>
21 <xsl:value-of select="count(/api/symbols/function)"/>
22 <xsl:text> functions</xsl:text>
24 <xsl:message terminate="no">
25 <xsl:text>Looking for variables in symbols.xml</xsl:text>
27 <xsl:apply-templates select="/api/symbols/variable"/>
28 <xsl:message terminate="no">
29 <xsl:text>Found </xsl:text>
30 <xsl:value-of select="count(/api/symbols/variable)"/>
31 <xsl:text> variables</xsl:text>
35 <xsl:template match="function|variable">
36 <xsl:variable name="name" select="@name"/>
37 <xsl:variable name="symbol"
38 select="$syms/symbols/release/symbol[. = $name]"/>
39 <xsl:if test="string($symbol) != $name">
40 <xsl:message terminate="yes">
41 <xsl:text>Failed to find export in symbols.xml: </xsl:text>
42 <xsl:value-of select="$name"/>