1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3* © 2017 and later: Unicode, Inc. and others. 4* License & terms of use: http://www.unicode.org/copyright.html 5--> 6<!-- 7/* 8******************************************************************************* 9* Copyright (C) 2016 and later: Unicode, Inc. and others. 10* License & terms of use: http://www.unicode.org/copyright.html 11* Copyright (C) 2008-2010, International Business Machines Corporation and * 12* others. All Rights Reserved. * 13******************************************************************************* 14* This is the XSLT for the API Report, XML style 15*/ 16--> 17<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 18<!-- 19 <xsl:param name="leftStatus" /> 20 <xsl:param name="rightStatus" /> 21--> 22 <xsl:param name="leftVer" /> 23 <xsl:param name="rightVer" /> 24 <xsl:param name="dateTime" /> 25 <xsl:param name="nul" /> 26 27 <!-- <xsl:param name="ourYear" /> --> 28 29 30 <xsl:template match="/"> 31 <xsl:comment> 32 Copyright © 2017 and later: Unicode, Inc. and others. 33 License & terms of use: http://www.unicode.org/copyright.html 34 </xsl:comment> 35 <changeReport> 36 <identity> 37 <xsl:attribute name="left"> 38 <xsl:value-of select="$leftVer"/> 39 </xsl:attribute> 40 <xsl:attribute name="right"> 41 <xsl:value-of select="$rightVer" /> 42 </xsl:attribute> 43 <xsl:attribute name="generated-date"> 44 <xsl:value-of select="$dateTime" /> 45 </xsl:attribute> 46 </identity> 47 48 <!-- <link rel="stylesheet" href="icu4c.css" type="text/css" /> --> 49 50 <functions name="removed"> 51 <xsl:call-template name="genTable"> 52 <xsl:with-param name="nodes" select="/list/func[@rightStatus=$nul]"/> 53 </xsl:call-template> 54 </functions> 55 56 <functions name="deprecated"> 57 <xsl:call-template name="genTable"> 58 <xsl:with-param name="nodes" select="/list/func[(@rightStatus='Deprecated' and @leftStatus!='Deprecated') or (@rightStatus='Obsolete' and @leftStatus!='Obsolete')]"/> 59 </xsl:call-template> 60 </functions> 61 62 <functions name="changed"> 63 <xsl:call-template name="genTable"> 64 <xsl:with-param name="nodes" select="/list/func[(@leftStatus != $nul) and (@rightStatus != $nul) and ( (@leftStatus != @rightStatus) or (@leftVersion != @rightVersion) )]"/> 65 </xsl:call-template> 66 </functions> 67 68 <functions name="promoted"> 69 <xsl:call-template name="genTable"> 70 <xsl:with-param name="nodes" select="/list/func[@leftStatus != 'Stable' and @rightStatus = 'Stable']"/> 71 </xsl:call-template> 72 </functions> 73 74 <functions name="added"> 75 <xsl:call-template name="genTable"> 76 <xsl:with-param name="nodes" select="/list/func[@leftStatus=$nul]"/> 77 </xsl:call-template> 78 </functions> 79 80 <functions name="draft"> 81 <xsl:call-template name="infoTable"> 82 <xsl:with-param name="nodes" select="/list/func[@rightStatus = 'Draft' and @rightVersion != $rightVer]"/> 83 </xsl:call-template> 84 </functions> 85 86 </changeReport> 87 </xsl:template> 88 89 <xsl:template name="genTable"> 90 <xsl:param name="nodes" /> 91 <table class='genTable' BORDER="1"> 92 <THEAD> 93 <tr> 94 <th> <xsl:value-of select="'File'" /> </th> 95 <th> <xsl:value-of select="'API'" /> </th> 96 <th> <xsl:value-of select="$leftVer" /> </th> 97 <th> <xsl:value-of select="$rightVer" /> </th> 98 </tr> 99 </THEAD> 100 101 <xsl:for-each select="$nodes"> 102 <xsl:sort select="@file" /> 103 104 <tr> 105 <xsl:attribute name="class"> 106 <xsl:value-of select="'row'"/> 107 <xsl:value-of select="(position() mod 2)"/> 108 <!-- 109 <xsl:choose> 110 <xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when> 111 <xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise> 112 </xsl:choose> 113 --> 114 </xsl:attribute> 115 <td class='file'> <xsl:value-of select="@file" /> </td> 116 <td class='proto'> <xsl:value-of select="@prototype" /> </td> 117 <td> 118 <xsl:attribute name="class"> 119 <xsl:if test ="@leftStatus = 'Stable'"> 120 <xsl:value-of select="'stabchange'" /> 121 </xsl:if> 122 </xsl:attribute> 123 <xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion"> 124 <xsl:attribute name="colspan"> 125 2 126 </xsl:attribute> 127 <xsl:attribute name="align"> 128 center 129 </xsl:attribute> 130 </xsl:if> 131 132 <xsl:value-of select="@leftStatus" /><xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">>Stable</xsl:if> 133 <br/> <xsl:value-of select="@leftVersion" /> 134 </td> 135 <xsl:if test = "@leftStatus != 'Draft' or @rightStatus != 'Stable' or @leftVersion != @rightVersion"> 136 <td> <xsl:value-of select="@rightStatus" /> 137 <br/> 138 <span> 139 <xsl:attribute name="class"> 140 <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''"> 141 <xsl:value-of select="'verchange'" /> 142 </xsl:if> 143 </xsl:attribute> 144 <span> 145 <xsl:value-of select="@rightVersion" /> 146 </span> 147 <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'"> 148 <br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b> 149 </xsl:if> 150 <xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer"> 151 <br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b> 152 </xsl:if> 153 <xsl:if test="@leftStatus = 'None' and @rightVersion = ''"> 154 <br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b> 155 </xsl:if> 156 </span> 157 </td> 158 </xsl:if> 159 </tr> 160 </xsl:for-each> 161 </table> 162 </xsl:template> 163 164 <xsl:template name="infoTable"> 165 <xsl:param name="nodes" /> 166 <table class='genTable' BORDER="1"> 167 <THEAD> 168 <tr> 169 <th> <xsl:value-of select="'File'" /> </th> 170 <th> <xsl:value-of select="'API'" /> </th> 171 <th> <xsl:value-of select="$leftVer" /> </th> 172 <th> <xsl:value-of select="$rightVer" /> </th> 173 </tr> 174 </THEAD> 175 176 <xsl:for-each select="$nodes"> 177 <xsl:sort select="@file" /> 178 179 <tr> 180 <xsl:attribute name="class"> 181 <xsl:value-of select="'row'"/> 182 <xsl:value-of select="(position() mod 2)"/> 183 <!-- 184 <xsl:choose> 185 <xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when> 186 <xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise> 187 </xsl:choose> 188 --> 189 </xsl:attribute> 190 <td class='file'> <xsl:value-of select="@file" /> </td> 191 <td class='proto'> <xsl:value-of select="@prototype" /> </td> 192 <td> 193 <xsl:attribute name="class"> 194 <xsl:if test ="@leftStatus = 'Stable'"> 195 <xsl:value-of select="'stabchange'" /> 196 </xsl:if> 197 </xsl:attribute> 198 199 <xsl:if test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion"> 200 <xsl:attribute name="colspan"> 201 2 202 </xsl:attribute> 203 <xsl:attribute name="align"> 204 center 205 </xsl:attribute> 206 </xsl:if> 207 208 <xsl:value-of select="@leftStatus" /> 209 <br/> <xsl:value-of select="@leftVersion" /> 210 </td> 211 <xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion"> 212 <td> <xsl:value-of select="@rightStatus" /> 213 <br/> 214 <span> 215 <xsl:attribute name="class"> 216 <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''"> 217 <xsl:value-of select="'verchange'" /> 218 </xsl:if> 219 </xsl:attribute> 220 <span> 221 <xsl:value-of select="@rightVersion" /> 222 </span> 223 <!-- 224 <xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'"> 225 <br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b> 226 </xsl:if> 227 <xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer"> 228 <br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b> 229 </xsl:if> 230 <xsl:if test="@leftStatus = 'None' and @rightVersion = ''"> 231 <br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b> 232 </xsl:if> 233 --> 234 </span> 235 </td> 236 </xsl:if> 237 </tr> 238 </xsl:for-each> 239 </table> 240 </xsl:template> 241 242</xsl:stylesheet> 243 244 245 246 247