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<xsl:stylesheet
22    version="1.0"
23    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
24    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
25    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
26    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
27    xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
28    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
29    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
30    xmlns:xlink="http://www.w3.org/1999/xlink"
31    xmlns:dc="http://purl.org/dc/elements/1.1/"
32    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
33    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
34    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
35    xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
36    xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
37    xmlns:math="http://www.w3.org/1998/Math/MathML"
38    xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
39    xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
40    xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
41    xmlns:ooo="http://openoffice.org/2004/office"
42    xmlns:ooow="http://openoffice.org/2004/writer"
43    xmlns:oooc="http://openoffice.org/2004/calc"
44    xmlns:dom="http://www.w3.org/2001/xml-events"
45    xmlns:xforms="http://www.w3.org/2002/xforms"
46    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
47    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
49    xmlns:rng="http://relaxng.org/ns/structure/1.0"
50    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
51    xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
52  <xsl:output method="text" />
53  <xsl:param name="prefix"/>
54
55  <xsl:include href="factorytools.xsl"/>
56
57  <xsl:template name="factorynamespaceiddecls">
58    <xsl:for-each select="/model/namespace">
59      <xsl:sort select="@name"/>
60      <xsl:text>
61extern const Id </xsl:text>
62<xsl:call-template name="idfornamespace"/>
63<xsl:text>;</xsl:text>
64    </xsl:for-each>
65  </xsl:template>
66
67  <xsl:template name="factorynamespaceidimpls">
68    <xsl:for-each select="/model/namespace">
69      <xsl:sort select="@name"/>
70      <xsl:text>
71const Id </xsl:text>
72<xsl:call-template name="idfornamespace"/>
73<xsl:text> = </xsl:text>
74<xsl:value-of select="position()"/>
75<xsl:text> &lt;&lt; 16;</xsl:text>
76    </xsl:for-each>
77</xsl:template>
78
79  <xsl:template match="/">
80    <xsl:text>
81#ifndef OOXML_FACTORY_GENERATED_HXX
82#define OOXML_FACTORY_GENERATED_HXX
83
84namespace writerfilter {
85namespace ooxml {
86
87/// @cond GENERATED
88    </xsl:text>
89    <xsl:call-template name="factorynamespaceidimpls"/>
90    <xsl:call-template name="factorydefineidimpls"/>
91    <xsl:text>
92/// @endcond
93}}
94
95#endif // OOXML_FACTORY_GENERATED_HXX
96</xsl:text>
97</xsl:template>
98
99</xsl:stylesheet>
100