1<!--***********************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 ***********************************************************-->
21
22
23<xsl:stylesheet
24    version="1.0"
25    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
27    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
28    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
29    xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
30    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
31    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
32    xmlns:xlink="http://www.w3.org/1999/xlink"
33    xmlns:dc="http://purl.org/dc/elements/1.1/"
34    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
35    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
36    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
37    xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
38    xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
39    xmlns:math="http://www.w3.org/1998/Math/MathML"
40    xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
41    xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
42    xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
43    xmlns:ooo="http://openoffice.org/2004/office"
44    xmlns:ooow="http://openoffice.org/2004/writer"
45    xmlns:oooc="http://openoffice.org/2004/calc"
46    xmlns:dom="http://www.w3.org/2001/xml-events"
47    xmlns:xforms="http://www.w3.org/2002/xforms"
48    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
49    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
50    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
51    xmlns:rng="http://relaxng.org/ns/structure/1.0"
52    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
53    xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
54  <xsl:output method="text" />
55  <xsl:param name="prefix"/>
56
57  <xsl:include href="factorytools.xsl"/>
58
59  <xsl:template name="fasttokens">
60    <xsl:text>
61typedef sal_Int32 Token_t;
62    </xsl:text>
63    <xsl:for-each select="/model/fasttoken">
64      <xsl:text>
65const Token_t OOXML_</xsl:text>
66<xsl:value-of select="translate(., '-', '_')"/>
67<xsl:text> = </xsl:text>
68<xsl:value-of select="position() - 1"/>
69<xsl:text>;</xsl:text>
70    </xsl:for-each>
71    <xsl:text>
72const Token_t OOXML_FAST_TOKENS_END =</xsl:text>
73<xsl:value-of select="count(/model/fasttoken)"/>
74<xsl:text>;&#xa;</xsl:text>
75  </xsl:template>
76
77  <xsl:template match="/">
78    <out xml:space="preserve">
79      <xsl:call-template name="licenseheader"/>
80      <xsl:text>
81#ifndef INCLUDED_OOXML_FAST_TOKENS_HXX
82#define INCLUDED_OOXML_FAST_TOKENS_HXX
83
84#include &lt;map&gt;
85#include &lt;vector&gt;
86#include &lt;boost/shared_ptr.hpp&gt;
87#include &lt;string&gt;
88
89#include &lt;resourcemodel/WW8ResourceModel.hxx&gt;
90
91namespace writerfilter {
92namespace ooxml {
93using namespace ::std;
94using namespace ::com::sun::star;
95</xsl:text>
96<xsl:call-template name="fasttokens"/>
97<xsl:text>
98string fastTokenToId(sal_uInt32 nToken);
99
100static const sal_uInt32 F_Attribute = 1U &lt;&lt; 31;
101
102}}
103#endif //INCLUDED_OOXML_FAST_TOKENS_HXX&#xa;</xsl:text></out></xsl:template>
104
105  <xsl:template match="*"/>
106</xsl:stylesheet>
107