merge the formfield patch from ooo-build
[ooovba.git] / writerfilter / source / doctok / resourcetools.xsl
blob8c1ef9d7703dcf288b022b07c1edf7154c85d251
1 <!--
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * Copyright 2008 by Sun Microsystems, Inc.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * $RCSfile: resourcetools.xsl,v $
12 * $Revision: 1.8 $
14 * This file is part of OpenOffice.org.
16 * OpenOffice.org is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License version 3
18 * only, as published by the Free Software Foundation.
20 * OpenOffice.org is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Lesser General Public License version 3 for more details
24 * (a copy is included in the LICENSE file that accompanied this code).
26 * You should have received a copy of the GNU Lesser General Public License
27 * version 3 along with OpenOffice.org. If not, see
28 * <http://www.openoffice.org/license.html>
29 * for a copy of the LGPLv3 License.
31 ************************************************************************/
33 -->
34 <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#"
35 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
36 <xsl:output method="text" />
38 <xsl:template name='idtoqname'>
39 <xsl:param name='id'/>
40 <xsl:text>NS_</xsl:text>
41 <xsl:value-of select='substring-before($id, ":")'/>
42 <xsl:text>::LN_</xsl:text>
43 <xsl:value-of select='substring-after($id, ":")'/>
44 </xsl:template>
46 <xsl:template name="parenttype">
47 <xsl:param name='type'/>
48 <xsl:for-each select='/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$type]'>
49 <xsl:value-of select='./UML:Generalization.parent/UML:Class/@xmi.idref'/>
50 </xsl:for-each>
51 </xsl:template>
53 <xsl:template name='saltype'>
54 <xsl:param name='type'/>
55 <xsl:param name='parenttype'/>
56 <xsl:choose>
57 <xsl:when test="$type='U8'">sal_uInt8</xsl:when>
58 <xsl:when test="$type='S8'">sal_Int8</xsl:when>
59 <xsl:when test="$type='U16'">sal_uInt16</xsl:when>
60 <xsl:when test="$type='S16'">sal_Int16</xsl:when>
61 <xsl:when test="$type='U32'">sal_uInt32</xsl:when>
62 <xsl:when test="$type='S32'">sal_Int32</xsl:when>
63 <xsl:when test="$type='String'">rtl::OUString</xsl:when>
64 <xsl:otherwise>
65 <xsl:text>writerfilter::Reference &lt; </xsl:text>
66 <xsl:value-of select='$parenttype'/>
67 <xsl:text> &gt;::Pointer_t</xsl:text>
68 </xsl:otherwise>
69 </xsl:choose>
70 </xsl:template>
72 <xsl:template name='typetype'>
73 <xsl:param name='type'/><xsl:choose>
74 <xsl:when test="$type='U8'">simple</xsl:when>
75 <xsl:when test="$type='S8'">simple</xsl:when>
76 <xsl:when test="$type='U16'">simple</xsl:when>
77 <xsl:when test="$type='S16'">simple</xsl:when>
78 <xsl:when test="$type='U32'">simple</xsl:when>
79 <xsl:when test="$type='S32'">simple</xsl:when>
80 <xsl:when test="$type='String'">string</xsl:when>
81 <xsl:when test="$type='Binary'">binary</xsl:when>
82 <xsl:otherwise>complex</xsl:otherwise>
83 </xsl:choose>
84 </xsl:template>
86 <xsl:template name="valuetype">
87 <xsl:param name="type"/>
88 <xsl:choose>
89 <xsl:when test='$type="U8"'>WW8IntValue</xsl:when>
90 <xsl:when test='$type="S8"'>WW8IntValue</xsl:when>
91 <xsl:when test='$type="U16"'>WW8IntValue</xsl:when>
92 <xsl:when test='$type="S16"'>WW8IntValue</xsl:when>
93 <xsl:when test='$type="U32"'>WW8IntValue</xsl:when>
94 <xsl:when test='$type="S32"'>WW8IntValue</xsl:when>
95 <xsl:otherwise>WW8PropertiesValue</xsl:otherwise>
96 </xsl:choose>
97 </xsl:template>
99 <xsl:template match="UML:Attribute" mode="valuetype">
100 <xsl:call-template name="valuetype">
101 <xsl:with-param name="type" select='.//UML:DataType/@xmi.idref'/>
102 </xsl:call-template>
103 </xsl:template>
105 <xsl:template name="qnametostrattrs">
106 <xsl:text>
107 /* Attributes */</xsl:text>
108 <xsl:for-each select='.//UML:Attribute[@name!="reserved"]'>
109 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
110 <xsl:choose>
111 <xsl:when test='.//UML:Stereotype[@xmi.idref="noresolve"]'>
112 </xsl:when>
113 <xsl:otherwise>
114 <xsl:text>
115 mMap[</xsl:text>
116 <xsl:call-template name='idtoqname'>
117 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
118 </xsl:call-template>
119 <xsl:text>] = "</xsl:text>
120 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
121 <xsl:text>";</xsl:text>
122 </xsl:otherwise>
123 </xsl:choose>
124 </xsl:for-each>
125 </xsl:for-each>
126 </xsl:template>
128 <xsl:template name="qnametostrops">
129 <xsl:text>
130 /* Operations */</xsl:text>
131 <xsl:for-each select='.//UML:Operation[@name!="reserved"]'>
132 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
133 <xsl:choose>
134 <xsl:when test='.//UML:Stereotype[@xmi.idref="noresolve"]'>
135 </xsl:when>
136 <xsl:otherwise>
137 <xsl:text>
138 mMap[</xsl:text>
139 <xsl:call-template name='idtoqname'>
140 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
141 </xsl:call-template>
142 <xsl:text>] = "</xsl:text>
143 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
144 <xsl:text>";</xsl:text>
145 </xsl:otherwise>
146 </xsl:choose>
147 </xsl:for-each>
148 </xsl:for-each>
149 </xsl:template>
151 <xsl:template name="qnametostrclasses">
152 <xsl:text>
153 /* Classes */</xsl:text>
154 <xsl:for-each select='.//UML:Class[@name!="reserved"]'>
155 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
156 <xsl:text>
157 mMap[</xsl:text>
158 <xsl:call-template name='idtoqname'>
159 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
160 </xsl:call-template>
161 <xsl:text>] = "</xsl:text>
162 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
163 <xsl:text>";</xsl:text>
164 </xsl:for-each>
165 </xsl:for-each>
166 </xsl:template>
168 <xsl:template match='UML:Model' mode='qnametostr'>
169 <xsl:text>
170 void QNameToString::init_doctok()
171 {</xsl:text>
172 <xsl:call-template name="qnametostrattrs"/>
173 <xsl:call-template name="qnametostrops"/>
174 <xsl:call-template name="qnametostrclasses"/>
175 <xsl:text>
177 </xsl:text>
178 </xsl:template>
180 <xsl:key name="ids" match='UML:Attribute[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]|UML:Operation[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]' use=".//UML:TaggedValue.dataValue"/>
182 <xsl:template match="UML:Model" mode="qnametostrfunc">
183 <xsl:text>
184 string qnameToString(sal_uInt32 nToken)
186 string sResult;
188 switch (nToken)
190 // Attributes</xsl:text>
191 <xsl:for-each select='.//UML:Attribute[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
192 <xsl:choose>
193 <xsl:when test='.//UML:Stereotype[@xmi.idref="noresolve"]'>
194 </xsl:when>
195 <xsl:otherwise>
196 <xsl:if test="generate-id(key('ids', .//UML:TaggedValue.dataValue)[1])=generate-id(.)">
197 <xsl:text>
198 case </xsl:text>
199 <xsl:call-template name='idtoqname'>
200 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
201 </xsl:call-template>
202 <xsl:text>:
203 sResult = "</xsl:text>
204 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
205 <xsl:text>";
206 break;</xsl:text>
207 </xsl:if>
208 </xsl:otherwise>
209 </xsl:choose>
210 </xsl:for-each>
211 <xsl:text>
212 // Operations</xsl:text>
213 <xsl:for-each select='.//UML:Operation[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
214 <xsl:choose>
215 <xsl:when test='.//UML:Stereotype[@xmi.idref="noresolve"]'>
216 </xsl:when>
217 <xsl:otherwise>
218 <xsl:if test="generate-id(key('ids', .//UML:TaggedValue.dataValue)[1])=generate-id(.)">
219 <xsl:text>
220 case </xsl:text>
221 <xsl:call-template name='idtoqname'>
222 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
223 </xsl:call-template>
224 <xsl:text>:
225 sResult = "</xsl:text>
226 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
227 <xsl:text>";
228 break;</xsl:text>
229 </xsl:if>
230 </xsl:otherwise>
231 </xsl:choose>
232 </xsl:for-each>
233 <xsl:text>
234 // Classes:</xsl:text>
235 <xsl:for-each select='.//UML:Class[@name!="reserved"]//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
236 <xsl:text>
237 case </xsl:text>
238 <xsl:call-template name='idtoqname'>
239 <xsl:with-param name='id'><xsl:value-of select='.//UML:TaggedValue.dataValue'/></xsl:with-param>
240 </xsl:call-template>
241 <xsl:text>:
242 sResult = "</xsl:text>
243 <xsl:value-of select='.//UML:TaggedValue.dataValue'/>
244 <xsl:text>";
245 break;</xsl:text>
246 </xsl:for-each>
247 <xsl:text>
248 default:
252 return sResult;
253 }</xsl:text>
254 </xsl:template>
256 <xsl:template match='UML:Model' mode='sprmcodetostr'>
257 <xsl:text>
258 SprmIdToString::SprmIdToString()
259 {</xsl:text>
260 <xsl:variable name='tmp'>map &lt; sal_uInt32, string &gt; </xsl:variable>
261 <xsl:for-each select='.//UML:Class[.//UML:Stereotype/@xmi.idref="ww8sprm"]'>
262 <xsl:variable name="sprmconst">
263 <xsl:call-template name="sprmCodeOfClass"/>
264 </xsl:variable>
265 <xsl:text>
266 mMap[</xsl:text>
267 <xsl:value-of select="$sprmconst"/>
268 <xsl:text>] = "</xsl:text>
269 <xsl:value-of select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="sprmid"]//UML:TaggedValue.dataValue'/>
270 <xsl:text>";</xsl:text>
271 </xsl:for-each>
272 <xsl:text>
274 </xsl:text>
275 </xsl:template>
277 <xsl:key name="classes-with-kind" match="UML:TagDefinition[@xmi.idref='kind']"
278 use="ancestor::UML:TaggedValue/UML:TaggedValue.dataValue"/>
280 <xsl:template name="sprmCodeOfClass">
281 <xsl:variable name="tmp">
282 <xsl:text>sprm:</xsl:text>
283 <xsl:value-of select="substring-after(@name, 'sprm')"/>
284 </xsl:variable>
285 <xsl:call-template name="idtoqname">
286 <xsl:with-param name="id" select="$tmp"/>
287 </xsl:call-template>
288 </xsl:template>
290 <xsl:template name="sprmkindcase">
291 <xsl:param name="kind"/>
292 <xsl:for-each select="key('classes-with-kind', $kind)/ancestor::UML:Class">
293 <xsl:text>
294 case </xsl:text>
295 <xsl:call-template name="sprmCodeOfClass"/>
296 <xsl:text>:</xsl:text>
297 </xsl:for-each>
298 </xsl:template>
300 <xsl:template match="UML:Model" mode='sprmkind'>
301 <xsl:text>
302 Sprm::Kind SprmKind(sal_uInt32 sprmCode)
304 Sprm::Kind nResult = Sprm::UNKNOWN;
306 switch(sprmCode)
307 {</xsl:text>
308 <xsl:call-template name="sprmkindcase">
309 <xsl:with-param name="kind">paragraph</xsl:with-param>
310 </xsl:call-template>
311 <xsl:text>
312 nResult = Sprm::PARAGRAPH;
313 break;</xsl:text>
314 <xsl:call-template name="sprmkindcase">
315 <xsl:with-param name="kind">character</xsl:with-param>
316 </xsl:call-template>
317 <xsl:text>
318 nResult = Sprm::CHARACTER;
319 break;</xsl:text>
320 <xsl:call-template name="sprmkindcase">
321 <xsl:with-param name="kind">table</xsl:with-param>
322 </xsl:call-template>
323 <xsl:text>
324 nResult = Sprm::TABLE;
325 break;</xsl:text>
326 <xsl:text>
327 default:
328 break;
331 return nResult;
333 </xsl:text>
334 </xsl:template>
336 <xsl:template match="UML:Model" mode='sprmids'>
337 <xsl:text>
338 namespace NS_sprm { </xsl:text>
339 <xsl:for-each select=".//UML:Class[.//UML:Stereotype/@xmi.idref='ww8sprm']">
340 <xsl:variable name="sprmcode">
341 <xsl:value-of select=".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref = 'sprmcode']/UML:TaggedValue.dataValue"/>
342 </xsl:variable>
343 <xsl:variable name="sprmcodelower">
344 <xsl:value-of select="translate($sprmcode, 'ABCDEF', 'abcdef')"/>
345 </xsl:variable>
346 <xsl:variable name="sprmidname">
347 <xsl:text>LN_</xsl:text>
348 <xsl:value-of select="substring-after(@name, 'sprm')"/>
349 </xsl:variable>
350 <xsl:text>
351 const sal_uInt16 </xsl:text>
352 <xsl:value-of select="$sprmidname"/>
353 <xsl:text> = </xsl:text>
354 <xsl:value-of select="$sprmcodelower"/>
355 <xsl:text>;</xsl:text>
356 </xsl:for-each>
357 <xsl:text>
359 </xsl:text>
360 </xsl:template>
362 <xsl:template match="UML:Model" mode='sprmidsed'>
363 <xsl:text>#!/bin/sh
364 cat $1 \&#xa;</xsl:text>
365 <xsl:for-each select=".//UML:Class[.//UML:Stereotype/@xmi.idref='ww8sprm']">
366 <xsl:variable name="sprmcode">
367 <xsl:value-of select=".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref = 'sprmcode']/UML:TaggedValue.dataValue"/>
368 </xsl:variable>
369 <xsl:variable name="sprmcodelower">
370 <xsl:value-of select="translate($sprmcode, 'ABCDEF', 'abcdef')"/>
371 </xsl:variable>
372 <xsl:variable name="sprmidname">
373 <xsl:text>NS_sprm::LN_</xsl:text>
374 <xsl:value-of select="substring-after(@name, 'sprm')"/>
375 </xsl:variable>
376 <xsl:text>| sed "s/</xsl:text>
377 <xsl:value-of select="$sprmcode"/>
378 <xsl:text>/</xsl:text>
379 <xsl:value-of select="$sprmidname"/>
380 <xsl:text>/g" \&#xa;</xsl:text>
381 <xsl:text>| sed "s/</xsl:text>
382 <xsl:value-of select="$sprmcodelower"/>
383 <xsl:text>/</xsl:text>
384 <xsl:value-of select="$sprmidname"/>
385 <xsl:text>/g" \&#xa;</xsl:text>
386 </xsl:for-each>
387 <xsl:text> | cat&#xa;</xsl:text>
388 </xsl:template>
390 <xsl:template match="UML:Model" mode="sprmidstoxml">
391 <xsl:text>
392 void sprmidsToXML(::std::ostream &amp; out)
394 </xsl:text>
395 <xsl:for-each select=".//UML:Class[.//UML:Stereotype/@xmi.idref='ww8sprm']">
396 <xsl:variable name="sprmcode">
397 <xsl:value-of select=".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref = 'sprmcode']/UML:TaggedValue.dataValue"/>
398 </xsl:variable>
399 <xsl:variable name="sprmcodelower">
400 <xsl:value-of select="translate($sprmcode, 'ABCDEF', 'abcdef')"/>
401 </xsl:variable>
402 <xsl:variable name="sprmidname">
403 <xsl:text>sprm:</xsl:text>
404 <xsl:value-of select="substring-after(@name, 'sprm')"/>
405 </xsl:variable>
406 <xsl:text>
407 out &lt;&lt; "&lt;theid name=\"</xsl:text>
408 <xsl:value-of select="$sprmidname"/>
409 <xsl:text>\"&gt;</xsl:text>
410 <xsl:value-of select="$sprmcodelower"/>
411 <xsl:text>&lt;/theid&gt;" &lt;&lt; endl;</xsl:text>
412 </xsl:for-each>
413 <xsl:text>
415 </xsl:text>
416 </xsl:template>
418 <xsl:template match="UML:Model" mode='sprmreplace'>
419 <xsl:for-each select=".//UML:Class[.//UML:Stereotype/@xmi.idref='ww8sprm']">
420 <xsl:variable name="pattern">
421 <xsl:value-of select=".//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref = 'sprmcode']/UML:TaggedValue.dataValue"/>
422 </xsl:variable>
423 <xsl:variable name="lowerpattern">
424 <xsl:value-of select="translate($pattern, 'ABCDEF', 'abcdef')"/>
425 </xsl:variable>
426 <xsl:variable name="upperpattern">
427 <xsl:value-of select="translate($pattern, 'abcdef', 'ABCDEF')"/>
428 </xsl:variable>
429 <xsl:variable name="tmp">
430 <xsl:text>sprm:</xsl:text>
431 <xsl:value-of select="substring-after(@name, 'sprm')"/>
432 </xsl:variable>
433 <xsl:variable name="constname">
434 <xsl:call-template name="idtoqname">
435 <xsl:with-param name="id" select="$tmp"/>
436 </xsl:call-template>
437 </xsl:variable>
438 <xsl:text>
439 sed "s/</xsl:text>
440 <xsl:value-of select="$lowerpattern"/>
441 <xsl:text>/</xsl:text>
442 <xsl:value-of select="$constname"/>
443 <xsl:text>/g" &lt; $1 > $1.out &amp;&amp; mv $1.out $1 </xsl:text>
444 <xsl:text>
445 sed "s/</xsl:text>
446 <xsl:value-of select="$upperpattern"/>
447 <xsl:text>/</xsl:text>
448 <xsl:value-of select="$constname"/>
449 <xsl:text>/g" &lt; $1 > $1.out &amp;&amp; mv $1.out $1 </xsl:text>
450 </xsl:for-each>
451 <xsl:text>&#xa;</xsl:text>
452 </xsl:template>
454 <!-- Key all attributes with the same name and same value -->
455 <xsl:key name="same-valued-tagged-data"
456 match="UML:TaggedValue.dataValue" use="." />
458 <xsl:template name="analyzerdoctokidsattrs">
459 <xsl:text>
460 /* Attributes */</xsl:text>
461 <xsl:for-each select='.//UML:Attribute[@name!="reserved"]'>
462 <xsl:if test='count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0'>
463 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="attrid"]'>
464 <xsl:choose>
465 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
466 <xsl:otherwise>
467 <xsl:text>
468 out &lt;&lt; "&lt;theid name=\"</xsl:text>
469 <xsl:value-of select=".//UML:TaggedValue.dataValue"/>
470 <xsl:text>\"&gt;</xsl:text>
471 <xsl:value-of select='10000 + position()'/>
472 <xsl:text>&lt;/theid&gt;" &lt;&lt; endl;</xsl:text>
473 </xsl:otherwise>
474 </xsl:choose>
475 </xsl:for-each>
476 </xsl:if>
477 </xsl:for-each>
478 </xsl:template>
480 <xsl:template name="analyzerdoctokidsops">
481 <xsl:text>
482 /* Operations */</xsl:text>
483 <xsl:for-each select='.//UML:Operation[@name!="reserved"]'>
484 <xsl:if test='count(.//UML:Stereotype[@xmi.idref="noqname"]) = 0'>
485 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="opid"]'>
486 <xsl:choose>
487 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
488 <xsl:otherwise>
489 <xsl:text>
490 out &lt;&lt; "&lt;theid name=\"</xsl:text>
491 <xsl:value-of select=".//UML:TaggedValue.dataValue"/>
492 <xsl:text>\"&gt;</xsl:text>
493 <xsl:value-of select='20000 + position()'/>
494 <xsl:text>&lt;/theid&gt;" &lt;&lt; endl;</xsl:text>
495 </xsl:otherwise>
496 </xsl:choose>
497 </xsl:for-each>
498 </xsl:if>
499 </xsl:for-each>
500 </xsl:template>
502 <xsl:template name="analyzerdoctokidsclasses">
503 <xsl:text>
504 /* clases */</xsl:text>
505 <xsl:for-each select='.//UML:Class[@name!="reserved"]'>
506 <xsl:for-each select='.//UML:TaggedValue[.//UML:TagDefinition/@xmi.idref="classid"]'>
507 <xsl:choose>
508 <xsl:when test='.//UML:Stereotype[@xmi.idref="noqname"]'/>
509 <xsl:when test='generate-id(UML:TaggedValue.dataValue) != generate-id(key("same-valued-tagged-data", UML:TaggedValue.dataValue)[1])'/>
510 <xsl:otherwise>
511 <xsl:text>
512 out &lt;&lt; "&lt;theid name=\"</xsl:text>
513 <xsl:value-of select=".//UML:TaggedValue.dataValue"/>
514 <xsl:text>\"&gt;</xsl:text>
515 <xsl:value-of select='30000 + position()'/>
516 <xsl:text>&lt;/theid&gt;" &lt;&lt; endl;</xsl:text>
517 </xsl:otherwise>
518 </xsl:choose>
519 </xsl:for-each>
520 </xsl:for-each>
521 </xsl:template>
523 <xsl:template match="UML:Model" mode="analyzerdoctokids">
524 <xsl:text>
525 void doctokidsToXML(::std::ostream &amp; out)
526 {</xsl:text>
527 <xsl:call-template name="analyzerdoctokidsattrs"/>
528 <xsl:call-template name="analyzerdoctokidsops"/>
529 <xsl:call-template name="analyzerdoctokidsclasses"/>
530 <xsl:text>
532 </xsl:text>
533 </xsl:template>
535 <xsl:template name="licenseheader">
536 <xsl:text>
537 /*************************************************************************
539 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
541 * Copyright 2008 by Sun Microsystems, Inc.
543 * OpenOffice.org - a multi-platform office productivity suite
545 * $RCSfile: resourcetools.xsl,v $
547 * $Revision: 1.8 $
549 * This file is part of OpenOffice.org.
551 * OpenOffice.org is free software: you can redistribute it and/or modify
552 * it under the terms of the GNU Lesser General Public License version 3
553 * only, as published by the Free Software Foundation.
555 * OpenOffice.org is distributed in the hope that it will be useful,
556 * but WITHOUT ANY WARRANTY; without even the implied warranty of
557 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
558 * GNU Lesser General Public License version 3 for more details
559 * (a copy is included in the LICENSE file that accompanied this code).
561 * You should have received a copy of the GNU Lesser General Public License
562 * version 3 along with OpenOffice.org. If not, see
563 * http://www.openoffice.org/license.html
564 * for a copy of the LGPLv3 License.
566 ************************************************************************/
569 THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
572 &#xa;</xsl:text>
573 </xsl:template>
574 </xsl:stylesheet>