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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
24                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
25  <xsl:output method="text" />
26
27  <!-- Key all attributes with the same name and same value -->
28  <xsl:key name="same-valued-tagged-data"
29           match="UML:TaggedValue.dataValue" use="." />
30
31  <xsl:template match="/">
32    <out>
33      <xsl:text>
34/**************************************************************
35 *
36 * Licensed to the Apache Software Foundation (ASF) under one
37 * or more contributor license agreements.  See the NOTICE file
38 * distributed with this work for additional information
39 * regarding copyright ownership.  The ASF licenses this file
40 * to you under the Apache License, Version 2.0 (the
41 * "License"); you may not use this file except in compliance
42 * with the License.  You may obtain a copy of the License at
43 *
44 *   http://www.apache.org/licenses/LICENSE-2.0
45 *
46 * Unless required by applicable law or agreed to in writing,
47 * software distributed under the License is distributed on an
48 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
49 * KIND, either express or implied.  See the License for the
50 * specific language governing permissions and limitations
51 * under the License.
52 *
53 *************************************************************/
54/*
55
56   THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
57
58*/
59#ifndef INCLUDED_RESOURCESIDS
60#define INCLUDED_RESOURCESIDS
61
62#include &lt;sal/types.h&gt;
63#include &lt;resourcemodel/WW8ResourceModel.hxx&gt;
64
65namespace writerfilter {
66
67namespace NS_rtf {
68
69/* Attributes */</xsl:text>
70<xsl:for-each select='.//UML:Attribute[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]'>
71  <xsl:variable name="pos" select="position()"/>
72  <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
73    <xsl:choose>
74      <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
75      <!-- <xsl:when test='.//UML:TaggedValue.dataValue = preceding::*//UML:TaggedValue.dataValue'/>-->
76      <xsl:otherwise>
77        <xsl:text>
78const Id </xsl:text>
79        <xsl:call-template name='idtoqname'>
80          <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
81        </xsl:call-template>
82        <xsl:text> = </xsl:text>
83        <xsl:variable name="id" select="10000 + $pos"/>
84        <xsl:value-of select='$id'/>
85        <xsl:text>; // 0x</xsl:text>
86        <xsl:call-template name="dectohex">
87          <xsl:with-param name="number" select="$id"/>
88        </xsl:call-template>
89      </xsl:otherwise>
90    </xsl:choose>
91  </xsl:for-each>
92</xsl:for-each>
93<xsl:text>
94
95/* Operations */</xsl:text>
96<xsl:for-each select='.//UML:Operation[@name!="reserved"][count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0]'>
97  <xsl:variable name="pos" select="position()"/>
98  <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
99    <xsl:choose>
100      <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
101      <xsl:otherwise>
102        <xsl:text>
103const Id </xsl:text>
104<xsl:call-template name='idtoqname'>
105  <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
106</xsl:call-template>
107<xsl:text> = </xsl:text>
108<xsl:variable name="id" select="20000 + $pos"/>
109<xsl:value-of select='$id'/>
110<xsl:text>; // 0x</xsl:text>
111<xsl:call-template name="dectohex">
112  <xsl:with-param name="number" select="$id"/>
113</xsl:call-template>
114      </xsl:otherwise>
115    </xsl:choose>
116  </xsl:for-each>
117</xsl:for-each>
118<xsl:text>
119
120/* Classes */</xsl:text>
121<xsl:for-each select='.//UML:Class[@name!="reserved"]'>
122  <xsl:variable name="pos" select="position()"/>
123  <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
124    <xsl:choose>
125      <xsl:when test='.//UML:Stereotype[@xmi.idref="noqname"]'/>
126      <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
127      <xsl:otherwise>
128        <xsl:text>
129const Id </xsl:text>
130<xsl:call-template name='idtoqname'>
131  <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
132</xsl:call-template>
133<xsl:text> = </xsl:text>
134<xsl:value-of select='30000 + $pos'/>
135<xsl:text>; // 0x</xsl:text>
136<xsl:call-template name="dectohex">
137  <xsl:with-param name="number" select="30000 + position()"/>
138</xsl:call-template>
139      </xsl:otherwise>
140    </xsl:choose>
141  </xsl:for-each>
142</xsl:for-each>
143<xsl:text>
144}
145
146namespace NS_dff
147{</xsl:text>
148<xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.idref="dffopt"]'>
149  <xsl:variable name ="optname">
150    <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="optname"]/UML:TaggedValue.dataValue'/>
151  </xsl:variable>
152  <xsl:variable name="fopid">
153    <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="fopid"]'>
154      <xsl:value-of select='UML:TaggedValue.dataValue'/>
155    </xsl:for-each>
156  </xsl:variable>
157  <xsl:text>
158const Id </xsl:text>
159  <xsl:call-template name="idtoqname">
160    <xsl:with-param name="id"><xsl:value-of select="$optname"/></xsl:with-param>
161  </xsl:call-template>
162  <xsl:text> = </xsl:text>
163  <xsl:value-of select="$fopid"/>
164  <xsl:text>; // 0x</xsl:text>
165  <xsl:call-template name="dectohex">
166    <xsl:with-param name="number" select="$fopid"/>
167  </xsl:call-template>
168</xsl:for-each>
169<xsl:text>
170}
171
172
173}
174
175#endif // INCLUDED_RESOURCESIDS&#xa;</xsl:text></out>
176</xsl:template>
177
178<xsl:template name='idtoqname'>
179  <xsl:param name='id'/>LN_<xsl:value-of select='substring-after($id, ":")'/>
180</xsl:template>
181
182<xsl:template name='dectohex'>
183  <xsl:param name="number"/>
184  <xsl:if test="$number > 16">
185    <xsl:call-template name="dectohex">
186      <xsl:with-param name="number" select="floor($number div 16)"/>
187    </xsl:call-template>
188  </xsl:if>
189  <xsl:value-of select="substring('0123456789abcdef', $number mod 16 + 1, 1)"/>
190</xsl:template>
191
192</xsl:stylesheet>
193