2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v.
2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/
2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version
2.0 (the
"License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-
2.0 .
18 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:
xhtml=
"http://www.w3.org/1999/xhtml">
19 <xsl:output method=
"text" encoding=
"iso-8859-1"/>
21 <xsl:template match=
"/">
22 <xsl:apply-templates select=
"//xhtml:body/xhtml:table"/>
25 <xsl:template match=
"xhtml:table">
26 <xsl:apply-templates select=
"xhtml:tbody/xhtml:tr[2]"/>
29 <xsl:template name=
"handleTR">
30 <xsl:param name=
"offset"/>
31 <xsl:param name=
"shift"/>
32 <xsl:variable name=
"name"><xsl:value-of select=
"xhtml:td[3]"/></xsl:variable>
33 <xsl:variable name=
"type"><xsl:value-of select=
"xhtml:td[4]"/></xsl:variable>
34 <xsl:variable name=
"saltype">
36 <xsl:when test=
"$type='U8'">sal_uInt8
</xsl:when>
37 <xsl:when test=
"$type='S8'">sal_Int8
</xsl:when>
38 <xsl:when test=
"$type='U16'">sal_uInt16
</xsl:when>
39 <xsl:when test=
"$type='S16'">sal_Int16
</xsl:when>
40 <xsl:when test=
"$type='U32'">sal_uInt32
</xsl:when>
41 <xsl:when test=
"$type='S32'">sal_Int32
</xsl:when>
42 <xsl:otherwise>void *
</xsl:otherwise>
45 <xsl:variable name=
"bits"><xsl:value-of select=
"xhtml:td[5]"/></xsl:variable>
46 <xsl:variable name=
"mask"><xsl:value-of select=
"xhtml:td[6]"/></xsl:variable>
47 <xsl:variable name=
"comment"><xsl:value-of select=
"xhtml:td[7]"/></xsl:variable>
49 <xsl:value-of select=
"$comment"/>
51 offset :
<xsl:value-of select=
"$offset"/>
52 name :
<xsl:value-of select=
"$name"/>
53 type :
<xsl:value-of select=
"$type"/>
54 shift :
<xsl:value-of select=
"concat($shift, '
')"/>
57 <xsl:value-of select=
"$saltype"/> get_
<xsl:value-of select=
"$name"/>() const
<xsl:choose>
58 <xsl:when test=
"$saltype='void *'">;
60 <xsl:otherwise> { return (get
<xsl:value-of select=
"$type"/>(
0x
<xsl:value-of select=
"$offset"/>)
<xsl:if test=
"string-length($mask)>0"> & 0x
<xsl:value-of select=
"translate($mask, 'ABCDEF', 'abcdef')"/></xsl:if>)
<xsl:if test=
"$shift>0"> >> <xsl:value-of select=
"$shift"/></xsl:if>; }
65 <xsl:template match=
"xhtml:tr[./xhtml:td[position()=1]/text()]">
66 <xsl:variable name=
"offset"><xsl:value-of select=
"xhtml:td[2]"/></xsl:variable>
67 <xsl:call-template name=
"handleTR">
68 <xsl:with-param name=
"offset" select=
"$offset"/>
69 <xsl:with-param name=
"shift">0</xsl:with-param>
71 <xsl:variable name=
"shift1"><xsl:value-of select=
"substring-after(xhtml:td[5], ':')"/></xsl:variable>
72 <xsl:apply-templates select=
"following-sibling::xhtml:tr[position()=1]">
73 <xsl:with-param name=
"offset" select=
"$offset"/>
74 <xsl:with-param name=
"shift" select=
"$shift1"/>
75 </xsl:apply-templates>
78 <xsl:template match=
"xhtml:tr[not(./xhtml:td[position()=1]/text())]">
79 <xsl:param name=
"offset"/>
80 <xsl:param name=
"shift"/>
81 <xsl:call-template name=
"handleTR">
82 <xsl:with-param name=
"offset" select=
"$offset"/>
83 <xsl:with-param name=
"shift" select=
"$shift"/>
85 <xsl:variable name=
"shift1"><xsl:value-of select=
"$shift+substring-after(xhtml:td[5], ':')"/></xsl:variable>
86 <xsl:apply-templates select=
"following-sibling::xhtml:tr[position()=1]">
87 <xsl:with-param name=
"offset" select=
"$offset"/>
88 <xsl:with-param name=
"shift" select=
"$shift1"/>
89 </xsl:apply-templates>
92 <xsl:template match=
"*">
93 <xsl:copy-of select=
"."/>