paulb@322 | 1 | <?xml version="1.0"?> |
paulb@322 | 2 | <!-- |
paulb@322 | 3 | An experimental Qt Designer form conversion stylesheet. |
paulb@322 | 4 | |
paulb@322 | 5 | Copyright (C) 2005 Paul Boddie <paul@boddie.org.uk> |
paulb@322 | 6 | |
paulb@322 | 7 | This library is free software; you can redistribute it and/or |
paulb@322 | 8 | modify it under the terms of the GNU Lesser General Public |
paulb@322 | 9 | License as published by the Free Software Foundation; either |
paulb@322 | 10 | version 2.1 of the License, or (at your option) any later version. |
paulb@322 | 11 | |
paulb@322 | 12 | This library is distributed in the hope that it will be useful, |
paulb@322 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
paulb@322 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
paulb@322 | 15 | Lesser General Public License for more details. |
paulb@322 | 16 | |
paulb@322 | 17 | You should have received a copy of the GNU Lesser General Public |
paulb@322 | 18 | License along with this library; if not, write to the Free Software |
paulb@412 | 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
paulb@322 | 20 | --> |
paulb@322 | 21 | <xsl:stylesheet version="1.0" |
paulb@322 | 22 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
paulb@322 | 23 | xmlns:set="http://exslt.org/sets" |
paulb@323 | 24 | xmlns:math="http://exslt.org/math" |
paulb@322 | 25 | xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> |
paulb@322 | 26 | |
paulb@322 | 27 | <xsl:output indent="yes"/> |
paulb@322 | 28 | |
paulb@322 | 29 | |
paulb@322 | 30 | |
paulb@322 | 31 | <!-- Start at the top, producing a template file. --> |
paulb@322 | 32 | |
paulb@322 | 33 | <xsl:template match="UI"> |
paulb@322 | 34 | <html xmlns="http://www.w3.org/1999/xhtml"> |
paulb@322 | 35 | <head> |
paulb@322 | 36 | <title><xsl:value-of select="widget/property[@name='caption']/string/text()"/></title> |
paulb@322 | 37 | <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles/styles.css" rel="stylesheet" type="text/css" /> |
paulb@322 | 38 | <script type="text/javascript" src="scripts/sarissa.js"> </script> |
paulb@322 | 39 | <script type="text/javascript" src="scripts/XSLForms.js"> </script> |
paulb@322 | 40 | </head> |
paulb@322 | 41 | <body> |
paulb@367 | 42 | <form method="post"> |
paulb@367 | 43 | <xsl:apply-templates select="widget"/> |
paulb@367 | 44 | </form> |
paulb@322 | 45 | </body> |
paulb@322 | 46 | </html> |
paulb@322 | 47 | </xsl:template> |
paulb@322 | 48 | |
paulb@322 | 49 | |
paulb@322 | 50 | |
paulb@322 | 51 | <!-- Reproduce the layout. --> |
paulb@322 | 52 | |
paulb@322 | 53 | <xsl:template match="grid"> |
paulb@322 | 54 | <xsl:variable name="grid" select="."/> |
paulb@381 | 55 | <table xmlns="http://www.w3.org/1999/xhtml" width="100%"> |
paulb@322 | 56 | <!-- Get the row numbers in ascending order. --> |
paulb@322 | 57 | <xsl:for-each select="set:distinct($grid/*/@row)"> |
paulb@323 | 58 | <xsl:sort select="." data-type="number" order="ascending"/> |
paulb@322 | 59 | <xsl:variable name="row" select="."/> |
paulb@322 | 60 | <tr> |
paulb@322 | 61 | <!-- Get all elements in the row, ordered by column number. --> |
paulb@323 | 62 | <xsl:call-template name="grid-column"> |
paulb@323 | 63 | <xsl:with-param name="column" select="math:min($grid/*[@row=$row]/@column)"/> |
paulb@323 | 64 | <xsl:with-param name="row" select="$row"/> |
paulb@323 | 65 | <xsl:with-param name="grid" select="$grid"/> |
paulb@323 | 66 | <xsl:with-param name="last-column">-1</xsl:with-param> |
paulb@323 | 67 | </xsl:call-template> |
paulb@322 | 68 | </tr> |
paulb@322 | 69 | </xsl:for-each> |
paulb@322 | 70 | </table> |
paulb@322 | 71 | </xsl:template> |
paulb@322 | 72 | |
paulb@323 | 73 | <xsl:template name="grid-column"> |
paulb@323 | 74 | <xsl:param name="column"/> |
paulb@323 | 75 | <xsl:param name="row"/> |
paulb@323 | 76 | <xsl:param name="grid"/> |
paulb@323 | 77 | <xsl:param name="last-column"/> |
paulb@323 | 78 | <xsl:param name="last-colspan">1</xsl:param> |
paulb@323 | 79 | <!-- Insert missing cells. --> |
paulb@323 | 80 | <xsl:if test="$column != $last-column + $last-colspan"> |
paulb@325 | 81 | <xsl:variable name="spanned-columns" select="$grid/*[$row > @row and @row + @rowspan > $row and @column > $last-column and $column > @column]/@column"/> |
paulb@325 | 82 | <xsl:choose> |
paulb@325 | 83 | <xsl:when test="count($spanned-columns) != 0"> |
paulb@325 | 84 | <xsl:variable name="last-spanned-column" select="math:highest($spanned-columns)"/> |
paulb@325 | 85 | <xsl:variable name="last-spanned-colspan" select="$last-spanned-column/../@colspan"/> |
paulb@325 | 86 | <xsl:if test="$column != $last-spanned-column + $last-spanned-colspan"> |
paulb@325 | 87 | <td colspan="{$column - $last-spanned-column - $last-spanned-colspan}" xmlns="http://www.w3.org/1999/xhtml"> |
paulb@325 | 88 | </td> |
paulb@325 | 89 | </xsl:if> |
paulb@325 | 90 | </xsl:when> |
paulb@325 | 91 | <xsl:otherwise> |
paulb@325 | 92 | <td colspan="{$column - $last-column - $last-colspan}" xmlns="http://www.w3.org/1999/xhtml"> |
paulb@325 | 93 | </td> |
paulb@325 | 94 | </xsl:otherwise> |
paulb@325 | 95 | </xsl:choose> |
paulb@323 | 96 | </xsl:if> |
paulb@323 | 97 | <!-- Remember useful information. --> |
paulb@323 | 98 | <xsl:variable name="this-column" select="$grid/*[@row=$row and @column=$column]"/> |
paulb@323 | 99 | <xsl:variable name="this-colspan" select="$this-column/@colspan"/> |
paulb@323 | 100 | <!-- Insert this cell. --> |
paulb@323 | 101 | <td xmlns="http://www.w3.org/1999/xhtml"> |
paulb@323 | 102 | <!-- Add colspan and rowspan details. --> |
paulb@323 | 103 | <xsl:apply-templates select="$this-colspan|$this-column/@rowspan"/> |
paulb@323 | 104 | <!-- Transform the element. --> |
paulb@323 | 105 | <xsl:apply-templates select="$this-column"/> |
paulb@323 | 106 | </td> |
paulb@323 | 107 | <!-- Find remaining cells in this row. --> |
paulb@323 | 108 | <xsl:if test="count($grid/*[@row=$row and @column > $column]) > 0"> |
paulb@323 | 109 | <xsl:choose> |
paulb@323 | 110 | <xsl:when test="$this-colspan"> |
paulb@323 | 111 | <xsl:call-template name="grid-column"> |
paulb@323 | 112 | <xsl:with-param name="column" select="math:min($grid/*[@row=$row and @column > $column]/@column)"/> |
paulb@323 | 113 | <xsl:with-param name="row" select="$row"/> |
paulb@323 | 114 | <xsl:with-param name="grid" select="$grid"/> |
paulb@323 | 115 | <xsl:with-param name="last-column" select="$column"/> |
paulb@323 | 116 | <xsl:with-param name="last-colspan" select="$this-colspan"/> |
paulb@323 | 117 | </xsl:call-template> |
paulb@323 | 118 | </xsl:when> |
paulb@323 | 119 | <xsl:otherwise> |
paulb@323 | 120 | <xsl:call-template name="grid-column"> |
paulb@323 | 121 | <xsl:with-param name="column" select="math:min($grid/*[@row=$row and @column > $column]/@column)"/> |
paulb@323 | 122 | <xsl:with-param name="row" select="$row"/> |
paulb@323 | 123 | <xsl:with-param name="grid" select="$grid"/> |
paulb@323 | 124 | <xsl:with-param name="last-column" select="$column"/> |
paulb@323 | 125 | </xsl:call-template> |
paulb@323 | 126 | </xsl:otherwise> |
paulb@323 | 127 | </xsl:choose> |
paulb@323 | 128 | </xsl:if> |
paulb@323 | 129 | </xsl:template> |
paulb@323 | 130 | |
paulb@322 | 131 | <xsl:template match="spacer"> |
paulb@322 | 132 | </xsl:template> |
paulb@322 | 133 | |
paulb@322 | 134 | <xsl:template match="vbox"> |
paulb@322 | 135 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@322 | 136 | </xsl:template> |
paulb@322 | 137 | |
paulb@327 | 138 | <xsl:template match="hbox"> |
paulb@327 | 139 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@327 | 140 | </xsl:template> |
paulb@327 | 141 | |
paulb@322 | 142 | <xsl:template match="widget"> |
paulb@322 | 143 | <xsl:apply-templates select="property[@name='geometry']"/> |
paulb@322 | 144 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@322 | 145 | </xsl:template> |
paulb@322 | 146 | |
paulb@327 | 147 | <!-- Container widgets. --> |
paulb@322 | 148 | |
paulb@327 | 149 | <xsl:template match="widget[@class='QFrame']"> |
paulb@383 | 150 | <div xmlns="http://www.w3.org/1999/xhtml"> |
paulb@344 | 151 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@344 | 152 | <xsl:attribute name="template:element"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@344 | 153 | <xsl:apply-templates select="property[@name='geometry']"/> |
paulb@344 | 154 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@344 | 155 | </div> |
paulb@327 | 156 | </xsl:template> |
paulb@327 | 157 | |
paulb@327 | 158 | <xsl:template match="widget[@class='QTabWidget']"> |
paulb@327 | 159 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@327 | 160 | <xsl:attribute name="template:element"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@327 | 161 | <xsl:apply-templates select="property[@name='geometry']"/> |
paulb@327 | 162 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@327 | 163 | </xsl:template> |
paulb@327 | 164 | |
paulb@327 | 165 | <xsl:template match="widget[@class='QWidgetStack']"> |
paulb@327 | 166 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@327 | 167 | <xsl:attribute name="template:element"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@327 | 168 | <xsl:apply-templates select="property[@name='geometry']"/> |
paulb@327 | 169 | <xsl:apply-templates select="*[not(local-name() = 'property')]"/> |
paulb@327 | 170 | </xsl:template> |
paulb@327 | 171 | |
paulb@327 | 172 | <xsl:template match="widget[@class='QWidget']"> |
paulb@340 | 173 | <!-- NOTE: Suppress overriding of names. --> |
paulb@340 | 174 | <xsl:if test="not(../@class) or ../@class != 'QTabWidget'"> |
paulb@340 | 175 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@340 | 176 | <xsl:attribute name="template:element"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@340 | 177 | </xsl:if> |
paulb@327 | 178 | <xsl:apply-templates select="property[@name='geometry']"/> |
paulb@327 | 179 | <xsl:apply-templates select="*[not(local-name() = 'property') and not(local-name() = 'attribute')]"/> |
paulb@327 | 180 | </xsl:template> |
paulb@322 | 181 | |
paulb@322 | 182 | <!-- Specific widgets. --> |
paulb@322 | 183 | |
paulb@322 | 184 | <xsl:template match="widget[@class='QComboBox']"> |
paulb@322 | 185 | <select xmlns="http://www.w3.org/1999/xhtml"> |
paulb@322 | 186 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@359 | 187 | <xsl:variable name="field-name" select="$name-prop/cstring/text()"/> |
paulb@367 | 188 | <!-- NOTE: Adding _enum suffix. --> |
paulb@367 | 189 | <xsl:variable name="enum-name" select="concat($name-prop/cstring/text(), '_enum')"/> |
paulb@359 | 190 | <xsl:attribute name="template:multiple-choice-field"><xsl:value-of select="$field-name"/>,value</xsl:attribute> |
paulb@359 | 191 | <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute> |
paulb@359 | 192 | <xsl:apply-templates select="item"> |
paulb@359 | 193 | <xsl:with-param name="enum-name" select="$enum-name"/> |
paulb@359 | 194 | </xsl:apply-templates> |
paulb@322 | 195 | </select> |
paulb@322 | 196 | </xsl:template> |
paulb@322 | 197 | |
paulb@322 | 198 | <xsl:template match="widget[@class='QListBox']"> |
paulb@322 | 199 | <select xmlns="http://www.w3.org/1999/xhtml" multiple="multiple"> |
paulb@322 | 200 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@359 | 201 | <xsl:variable name="field-name" select="$name-prop/cstring/text()"/> |
paulb@367 | 202 | <!-- NOTE: Adding _enum suffix. --> |
paulb@367 | 203 | <xsl:variable name="enum-name" select="concat($name-prop/cstring/text(), '_enum')"/> |
paulb@359 | 204 | <xsl:attribute name="template:multiple-choice-list-field"><xsl:value-of select="$field-name"/>,<xsl:value-of select="$enum-name"/></xsl:attribute> |
paulb@359 | 205 | <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute> |
paulb@359 | 206 | <xsl:apply-templates select="item"> |
paulb@359 | 207 | <xsl:with-param name="enum-name" select="$enum-name"/> |
paulb@359 | 208 | <xsl:with-param name="item-type">list</xsl:with-param> |
paulb@359 | 209 | </xsl:apply-templates> |
paulb@322 | 210 | </select> |
paulb@322 | 211 | </xsl:template> |
paulb@322 | 212 | |
paulb@322 | 213 | <xsl:template match="item"> |
paulb@359 | 214 | <xsl:param name="enum-name"/> |
paulb@359 | 215 | <xsl:param name="item-type"/> |
paulb@322 | 216 | <option xmlns="http://www.w3.org/1999/xhtml"> |
paulb@359 | 217 | <xsl:choose> |
paulb@359 | 218 | <xsl:when test="$item-type = 'list'"> |
paulb@359 | 219 | <xsl:attribute name="template:multiple-choice-list-value"><xsl:value-of select="$enum-name"/>,value,selected</xsl:attribute> |
paulb@359 | 220 | </xsl:when> |
paulb@359 | 221 | <xsl:otherwise> |
paulb@359 | 222 | <xsl:attribute name="template:multiple-choice-value"><xsl:value-of select="$enum-name"/>,value,selected</xsl:attribute> |
paulb@359 | 223 | </xsl:otherwise> |
paulb@359 | 224 | </xsl:choose> |
paulb@322 | 225 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@322 | 226 | <xsl:attribute name="value"><xsl:value-of select="$value-prop/string/text()"/></xsl:attribute> |
paulb@322 | 227 | <xsl:value-of select="$value-prop/string/text()"/> |
paulb@322 | 228 | </option> |
paulb@322 | 229 | </xsl:template> |
paulb@322 | 230 | |
paulb@323 | 231 | <xsl:template match="widget[@class='QLabel']"> |
paulb@323 | 232 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@323 | 233 | <!-- NOTE: Permitting element generation from the text. --> |
paulb@323 | 234 | <xsl:value-of disable-output-escaping="yes" select="$value-prop/string/text()"/> |
paulb@323 | 235 | </xsl:template> |
paulb@323 | 236 | |
paulb@322 | 237 | <xsl:template match="widget[@class='QPushButton']"> |
paulb@322 | 238 | <input xmlns="http://www.w3.org/1999/xhtml" type="submit"> |
paulb@322 | 239 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@371 | 240 | <xsl:variable name="field-name" select="$name-prop/cstring/text()"/> |
paulb@322 | 241 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@371 | 242 | <xsl:choose> |
paulb@371 | 243 | <xsl:when test="starts-with($field-name, 'add_')"> |
paulb@371 | 244 | <xsl:variable name="affected-element" select="substring-after($field-name, 'add_')"/> |
paulb@371 | 245 | <xsl:attribute name="template:selector-field"><xsl:value-of select="$field-name"/>,<xsl:value-of select="$affected-element"/></xsl:attribute> |
paulb@371 | 246 | </xsl:when> |
paulb@371 | 247 | <xsl:when test="starts-with($field-name, 'remove_')"> |
paulb@371 | 248 | <xsl:variable name="affected-element" select="substring-after($field-name, 'remove_')"/> |
paulb@371 | 249 | <xsl:attribute name="template:selector-field"><xsl:value-of select="$field-name"/>,<xsl:value-of select="$affected-element"/></xsl:attribute> |
paulb@371 | 250 | </xsl:when> |
paulb@371 | 251 | <xsl:otherwise> |
paulb@371 | 252 | <xsl:attribute name="template:selector-field"><xsl:value-of select="$field-name"/></xsl:attribute> |
paulb@371 | 253 | </xsl:otherwise> |
paulb@371 | 254 | </xsl:choose> |
paulb@383 | 255 | <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute> |
paulb@322 | 256 | <xsl:attribute name="value"><xsl:value-of select="$value-prop/string/text()"/></xsl:attribute> |
paulb@322 | 257 | </input> |
paulb@322 | 258 | </xsl:template> |
paulb@322 | 259 | |
paulb@322 | 260 | <xsl:template match="widget[@class='QLineEdit']"> |
paulb@322 | 261 | <input xmlns="http://www.w3.org/1999/xhtml" type="text"> |
paulb@322 | 262 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@322 | 263 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@322 | 264 | <xsl:attribute name="template:attribute-field"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 265 | <xsl:attribute name="name"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 266 | <xsl:attribute name="value"><xsl:value-of select="$value-prop/string/text()"/></xsl:attribute> |
paulb@322 | 267 | </input> |
paulb@322 | 268 | </xsl:template> |
paulb@322 | 269 | |
paulb@322 | 270 | <xsl:template match="widget[@class='QTextEdit']"> |
paulb@322 | 271 | <textarea xmlns="http://www.w3.org/1999/xhtml"> |
paulb@322 | 272 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@322 | 273 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@322 | 274 | <xsl:attribute name="template:attribute-area"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 275 | <xsl:attribute name="name"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 276 | <xsl:value-of select="$value-prop/string/text()"/> |
paulb@322 | 277 | </textarea> |
paulb@322 | 278 | </xsl:template> |
paulb@322 | 279 | |
paulb@322 | 280 | <xsl:template match="widget[@class='QRadioButton']"> |
paulb@322 | 281 | <input xmlns="http://www.w3.org/1999/xhtml" type="radio"> |
paulb@322 | 282 | <xsl:variable name="name-prop" select="property[@name='name']"/> |
paulb@322 | 283 | <xsl:variable name="value-prop" select="property[@name='text']"/> |
paulb@322 | 284 | <xsl:attribute name="template:attribute-field"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 285 | <xsl:attribute name="name"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute> |
paulb@322 | 286 | <xsl:attribute name="value"><xsl:value-of select="$value-prop/string/text()"/></xsl:attribute> |
paulb@322 | 287 | </input> |
paulb@322 | 288 | </xsl:template> |
paulb@322 | 289 | |
paulb@322 | 290 | |
paulb@322 | 291 | |
paulb@322 | 292 | <!-- Geometry. --> |
paulb@322 | 293 | |
paulb@322 | 294 | <xsl:template match="property[@name='geometry']"> |
paulb@322 | 295 | <xsl:apply-templates select="rect/*[1]"> |
paulb@322 | 296 | <xsl:with-param name="style">position: absolute</xsl:with-param> |
paulb@322 | 297 | </xsl:apply-templates> |
paulb@322 | 298 | </xsl:template> |
paulb@322 | 299 | |
paulb@322 | 300 | <xsl:template name="make-geometry"> |
paulb@322 | 301 | <xsl:param name="style"/> |
paulb@322 | 302 | <xsl:variable name="dimension" select="following-sibling::*[1]"/> |
paulb@322 | 303 | <xsl:choose> |
paulb@322 | 304 | <xsl:when test="not($dimension)"> |
paulb@322 | 305 | <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute> |
paulb@322 | 306 | </xsl:when> |
paulb@322 | 307 | <xsl:otherwise> |
paulb@322 | 308 | <xsl:apply-templates select="$dimension"> |
paulb@322 | 309 | <xsl:with-param name="style" select="$style"/> |
paulb@322 | 310 | </xsl:apply-templates> |
paulb@322 | 311 | </xsl:otherwise> |
paulb@322 | 312 | </xsl:choose> |
paulb@322 | 313 | </xsl:template> |
paulb@322 | 314 | |
paulb@322 | 315 | <xsl:template match="x"> |
paulb@322 | 316 | <xsl:param name="style"/> |
paulb@322 | 317 | <xsl:call-template name="make-geometry"> |
paulb@322 | 318 | <xsl:with-param name="style"><xsl:value-of select="$style"/>; left: <xsl:value-of select="text()"/>px</xsl:with-param> |
paulb@322 | 319 | </xsl:call-template> |
paulb@322 | 320 | </xsl:template> |
paulb@322 | 321 | |
paulb@322 | 322 | <xsl:template match="y"> |
paulb@322 | 323 | <xsl:param name="style"/> |
paulb@322 | 324 | <xsl:call-template name="make-geometry"> |
paulb@322 | 325 | <xsl:with-param name="style"><xsl:value-of select="$style"/>; top: <xsl:value-of select="text()"/>px</xsl:with-param> |
paulb@322 | 326 | </xsl:call-template> |
paulb@322 | 327 | </xsl:template> |
paulb@322 | 328 | |
paulb@322 | 329 | <xsl:template match="width"> |
paulb@322 | 330 | <xsl:param name="style"/> |
paulb@322 | 331 | <xsl:call-template name="make-geometry"> |
paulb@322 | 332 | <xsl:with-param name="style"><xsl:value-of select="$style"/>; width: <xsl:value-of select="text()"/>px</xsl:with-param> |
paulb@322 | 333 | </xsl:call-template> |
paulb@322 | 334 | </xsl:template> |
paulb@322 | 335 | |
paulb@322 | 336 | <xsl:template match="height"> |
paulb@322 | 337 | <xsl:param name="style"/> |
paulb@322 | 338 | <xsl:call-template name="make-geometry"> |
paulb@322 | 339 | <xsl:with-param name="style"><xsl:value-of select="$style"/>; height: <xsl:value-of select="text()"/>px</xsl:with-param> |
paulb@322 | 340 | </xsl:call-template> |
paulb@322 | 341 | </xsl:template> |
paulb@322 | 342 | |
paulb@322 | 343 | |
paulb@322 | 344 | |
paulb@322 | 345 | <!-- Identification. --> |
paulb@322 | 346 | |
paulb@322 | 347 | <xsl:template match="property[@name='name']"> |
paulb@322 | 348 | </xsl:template> |
paulb@322 | 349 | |
paulb@322 | 350 | |
paulb@322 | 351 | |
paulb@322 | 352 | <!-- Labels and values. --> |
paulb@322 | 353 | |
paulb@322 | 354 | <xsl:template match="property[@name='text']"> |
paulb@322 | 355 | </xsl:template> |
paulb@322 | 356 | |
paulb@322 | 357 | |
paulb@322 | 358 | |
paulb@322 | 359 | <!-- Captions. --> |
paulb@322 | 360 | |
paulb@322 | 361 | <xsl:template match="property[@name='caption']"> |
paulb@322 | 362 | </xsl:template> |
paulb@322 | 363 | |
paulb@322 | 364 | |
paulb@322 | 365 | |
paulb@322 | 366 | <!-- Copy attributes. --> |
paulb@322 | 367 | |
paulb@322 | 368 | <xsl:template match="@*"> |
paulb@322 | 369 | <xsl:copy> |
paulb@322 | 370 | <xsl:apply-templates select="node()"/> |
paulb@322 | 371 | </xsl:copy> |
paulb@322 | 372 | </xsl:template> |
paulb@322 | 373 | |
paulb@322 | 374 | </xsl:stylesheet> |