• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!--
2    © 2019 and later: Unicode, Inc. and others.
3    License & terms of use: http://www.unicode.org/copyright.html
4    This is the XSLT for the API Report, Markdown version
5-->
6<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7  <xsl:param name="leftVer" />
8  <xsl:param name="rightVer" />
9  <xsl:param name="dateTime" />
10  <xsl:param name="rightMilestone" />
11  <xsl:param name="leftMilestone" />
12  <xsl:param name="notFound" />
13  <!-- <xsl:param name="ourYear" /> -->
14  <xsl:output method="text" indent="no" omit-xml-declaration="yes" />
15  <xsl:template match="/">
16  <!-- the generated file has a copyright of 2019 and following -->
17<![CDATA[<!--]]>
18 Copyright © 2019 and later: Unicode, Inc. and others.
19 License &amp; terms of use: http://www.unicode.org/copyright.html
20<![CDATA[-->]]>
21
22# ICU4C API Comparison: <xsl:value-of select="$leftVer"/><xsl:value-of select="$leftMilestone" /> with <xsl:value-of select="$rightVer" /><xsl:value-of select="$rightMilestone" />
23
24> _Note_ Markdown format of this document is new for ICU 65.
25
26- [Removed from <xsl:value-of select="$leftVer"/>](#removed)
27- [Deprecated or Obsoleted in <xsl:value-of select="$rightVer" />](#deprecated)
28- [Changed in  <xsl:value-of select="$rightVer" />](#changed)
29- [Promoted to stable in <xsl:value-of select="$rightVer" />](#promoted)
30- [Added in <xsl:value-of select="$rightVer" />](#added)
31- [Other existing drafts in <xsl:value-of select="$rightVer" />](#other)
32- [Signature Simplifications](#simplifications)
33
34## Removed
35
36Removed from <xsl:value-of select="$leftVer"/>
37<xsl:call-template name="genTable">
38    <xsl:with-param name="nodes" select="/list/func[@rightStatus=$notFound]"/>
39</xsl:call-template>
40
41## Deprecated
42
43Deprecated or Obsoleted in <xsl:value-of select="$rightVer" />
44
45<xsl:call-template name="genTable">
46    <xsl:with-param name="nodes" select="/list/func[(@rightStatus='Deprecated' and @leftStatus!='Deprecated') or (@rightStatus='Obsolete' and @leftStatus!='Obsolete')]"/>
47</xsl:call-template>
48
49## Changed
50
51Changed in  <xsl:value-of select="$rightVer" /> (old, new)
52
53<xsl:call-template name="genTable">
54    <xsl:with-param name="nodes" select="/list/func[(@leftStatus != $notFound) and (@rightStatus != $notFound) and ( (@leftStatus != @rightStatus) or (@leftVersion != @rightVersion) ) and not ( (@leftStatus = 'Draft') and (@rightStatus = 'Stable') and (@rightVersion = $rightVer) )]"/>
55</xsl:call-template>
56
57## Promoted
58
59Promoted to stable in <xsl:value-of select="$rightVer" />
60
61<xsl:call-template name="genTable">
62    <xsl:with-param name="nodes" select="/list/func[@leftStatus != 'Stable' and  @rightStatus = 'Stable']"/>
63</xsl:call-template>
64
65## Added
66
67Added in <xsl:value-of select="$rightVer" />
68
69<xsl:call-template name="genTable">
70    <xsl:with-param name="nodes" select="/list/func[@leftStatus=$notFound]"/>
71</xsl:call-template>
72
73## Other
74
75Other existing drafts in <xsl:value-of select="$rightVer" />
76
77<xsl:call-template name="infoTable"> <!--  note: note genTable -->
78    <xsl:with-param name="nodes" select="/list/func[@rightStatus = 'Draft' and @rightVersion != $rightVer]"/>
79</xsl:call-template>
80
81## Simplifications
82
83This section shows cases where the signature was "simplified" for the sake of comparison. The simplified form is in bold, followed by
84    all possible variations in "original" form.
85<xsl:for-each select="/list/simplifications/simplification">
86- **`<xsl:value-of select="base" />`**<xsl:for-each select="change">
87  - `<xsl:value-of select="text()" />`</xsl:for-each>
88</xsl:for-each>
89
90## Colophon
91
92Contents generated by StableAPI tool on <xsl:value-of select="$dateTime" />
93
94Copyright © 2019 and later: Unicode, Inc. and others.
95License &amp; terms of use: http://www.unicode.org/copyright.html
96  </xsl:template>
97
98  <!-- almost all sutables are generated by this -->
99  <xsl:template name="genTable"><xsl:param name="nodes" />
100
101| <xsl:value-of select="'File'" /> | <xsl:value-of select="'API'" /> | <xsl:value-of select="$leftVer" /> | <xsl:value-of select="$rightVer" /> |
102|---|---|---|---|<xsl:for-each select="$nodes"><xsl:sort select="@file" />
103<!--
104            <xsl:comment>
105              @prototype: <xsl:value-of select="@prototype" />
106              @leftStatus: <xsl:value-of select="@leftStatus" />
107              @leftVersion: <xsl:value-of select="@leftVersion" />
108              @rightStatus: <xsl:value-of select="@rightStatus" />
109              @rightVersion: <xsl:value-of select="@rightVersion" />
110            </xsl:comment>
111-->| <xsl:value-of select="@file" /> | <xsl:value-of disable-output-escaping="yes" select="@prototype" /> | <!-- <xsl:if
112    test ="@leftStatus = 'Stable'">
113                                <xsl:value-of select="'stabchange'" />
114                        </xsl:if>
115                    </xsl:attribute>
116                   	<xsl:if  test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">
117	                    <xsl:attribute name="colspan">2</xsl:attribute>
118	                    <xsl:attribute name="align">center</xsl:attribute>
119                   	</xsl:if> --> <xsl:value-of select="@leftStatus" /> <xsl:if
120                        test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">&#x2192;Stable</xsl:if><xsl:if
121                         test="@leftVersion != '' and @leftVersion != '.'"> <xsl:value-of select="@leftVersion" />  </xsl:if><xsl:if
122                          test="@leftStatus = '' and @leftVersion = ''"> _untagged _ </xsl:if><xsl:if
123                           test = "@leftStatus != 'Draft' or @rightStatus != 'Stable' or @leftVersion != @rightVersion"> | <xsl:value-of select="@rightStatus" /> <!--
124                        <xsl:attribute name="class">
125                            <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightVersion != '.'">
126                                <xsl:value-of select="'verchange'" />
127                            </xsl:if>
128                        </xsl:attribute>--><xsl:if test="@rightVersion != '.'"><xsl:value-of select="@rightVersion" /></xsl:if><xsl:if
129                        test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable' and not ( (@leftStatus = 'Draft') and (@rightStatus = 'Stable') and (@rightVersion = $rightVer) )">
130                            *(changed)*
131                        </xsl:if>
132                        <xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
133                            *(should be <xsl:value-of select="$rightVer"/>)*
134                        </xsl:if>
135                        <xsl:if test="@leftStatus = $notFound and @rightVersion = '' and @rightStatus != 'Internal' and @rightStatus != 'Deprecated'">
136                        	*(untagged)*
137                        </xsl:if>
138           </xsl:if><xsl:if  test = "@rightStatus = 'Stable' and @rightVersion = $rightVer">| *(Born Stable)* |</xsl:if></xsl:for-each>
139  </xsl:template>
140
141    <xsl:template name="infoTable">
142    <xsl:param name="nodes" />
143
144| <xsl:value-of select="'File'" /> | <xsl:value-of select="'API'" /> | <xsl:value-of select="$leftVer" /> | <xsl:value-of select="$rightVer" /> |
145|---|---|---|---|<xsl:for-each select="$nodes"><xsl:sort select="@file"
146    />
147| <xsl:value-of select="@file" /> |  <xsl:value-of disable-output-escaping="yes" select="@prototype" /> | <xsl:if
148 test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion"> <xsl:value-of select="@leftStatus" /> <xsl:value-of select="@leftVersion" /> | <xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion"> <xsl:value-of
149 select="@rightStatus" /> <xsl:if
150 test = "@rightVersion != '.'"><xsl:value-of select="@rightVersion" /></xsl:if></xsl:if></xsl:if></xsl:for-each>
151  </xsl:template>
152
153
154    <xsl:template name="pureVirtualTable">
155    <xsl:param name="nodes" />
156    <!--
157    <THEAD>
158        <tr>
159            <th> <xsl:value-of select="'File'" /> </th>
160            <th> <xsl:value-of select="'API'" /> </th>
161            <th> <xsl:value-of select="$leftVer" /> </th>
162            <th> <xsl:value-of select="$rightVer" /> </th>
163        </tr>
164    </THEAD>
165    -->
166
167        <xsl:for-each select="$nodes">
168            <xsl:sort select="@file" />
169
170            <tr>
171                <xsl:attribute name="class">
172                    <xsl:value-of select="'row'"/>
173                    <xsl:value-of select="(position() mod 2)"/>
174                    <!--
175                    <xsl:choose>
176                        <xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
177                        <xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
178                    </xsl:choose>
179                    -->
180                </xsl:attribute>
181                <td class='file'> <xsl:value-of select="@file" /> </td>
182                <td class='proto'> <xsl:value-of disable-output-escaping="yes" select="@prototype" /> </td>
183                <td>
184                    <xsl:attribute name="class">
185                        <xsl:if test ="@leftStatus = 'Stable'">
186                                <xsl:value-of select="'stabchange'" />
187                        </xsl:if>
188                    </xsl:attribute>
189
190                   	<xsl:if  test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion">
191	                    <xsl:attribute name="colspan">2</xsl:attribute>
192	                    <xsl:attribute name="align">center</xsl:attribute>
193                   	</xsl:if>
194
195                    <xsl:value-of select="@leftStatus" />
196                    <br/> <xsl:value-of select="@leftVersion" />
197                </td>
198                <xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion">
199                <td> <xsl:value-of select="@rightStatus" />
200                    <br/>
201                    <span>
202                        <xsl:attribute name="class">
203                            <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''">
204                                <xsl:value-of select="'verchange'" />
205                            </xsl:if>
206                        </xsl:attribute>
207                        <span>
208                            <xsl:value-of select="@rightVersion" />
209                        </span>
210                   <!--
211                        <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'">
212                            <br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
213                        </xsl:if>
214                        <xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
215                            <br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
216                        </xsl:if>
217                        <xsl:if test="@leftStatus = $notFound and @rightVersion = ''">
218                        	<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
219                        </xsl:if>
220                     -->
221                    </span>
222                </td>
223                </xsl:if>
224            </tr>
225        </xsl:for-each>
226  </xsl:template>
227
228</xsl:stylesheet>
229