2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 <xsl:output method="text" encoding="UTF-8"/>
6 <xsl:variable name="api" select="document('libxml2-api.xml')"/>
8 <xsl:template match="/">
10 # Officially exported symbols, for which header
11 # file definitions are installed in /usr/include/libxml2
13 # Automatically generated from symbols.xml and syms.xsl
15 # Versions here are *fixed* to match the libxml2 version
16 # at which the symbol was introduced. This ensures that
17 # a new client app requiring symbol foo() can't accidentally
18 # run with old libxml2.so not providing foo() - the global
19 # soname version info can't enforce this since we never
24 <xsl:apply-templates select="/symbols/release"/>
27 <xsl:template match="release">
28 <xsl:variable name="prev"
29 select="preceding-sibling::release[position()=1]"/>
30 <xsl:text>LIBXML2_</xsl:text>
31 <xsl:value-of select="string(@version)"/>
35 <xsl:for-each select="symbol">
36 <xsl:if test="string(preceding-sibling::symbol[position()=1]/@file) != string(@file)">
39 <xsl:value-of select="@file"/>
44 <xsl:apply-templates select="."/>
47 <xsl:text>} </xsl:text>
49 <xsl:text>LIBXML2_</xsl:text>
50 <xsl:value-of select="$prev/@version"/>
57 <xsl:template match="symbol">
58 <xsl:variable name="name" select="string(.)"/>
59 <xsl:variable name="file" select="string(@file)"/>
61 <xsl:when test="@removed">
62 <xsl:text># </xsl:text>
63 <xsl:value-of select="$name"/>
64 <xsl:text>; removed in </xsl:text>
65 <xsl:value-of select="@removed"/>
70 <!-- make sure we can find that symbol exported from the API list -->
71 <xsl:variable name="def"
72 select="$api/api/files/file[@name = $file]/exports[@symbol = $name]"/>
73 <xsl:if test="string($def/@symbol) != $name">
74 <xsl:message terminate="yes">
75 <xsl:text>Failed to find definition in libxml2-api.xml:</xsl:text>
76 <xsl:value-of select="$name"/>
80 <xsl:text> </xsl:text>
81 <xsl:value-of select="$name"/>
82 <xsl:text>;</xsl:text>
83 <xsl:if test="$def/@type = 'variable'">
84 <xsl:text> # variable</xsl:text>
86 <xsl:if test="@comment">
87 <xsl:text># </xsl:text>
88 <xsl:value-of select="@comment"/>