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:UML = 'org.omg.xmi.namespace.UML' xml:
space=
"default">
19 <xsl:output indent=
"yes"/>
20 <xsl:template match=
"/">
21 <XMI xmi.
version=
"1.2">
26 <UML:Model xmlns:
UML=
"org.omg.xmi.namespace.UML" name=
"WW8Document" >
27 <UML:Namespace.ownedElement
>
28 <xsl:apply-templates select=
"XMI/XMI.content/UML:Model/UML:Namespace.ownedElement"/>
29 </UML:Namespace.ownedElement
>
36 <xsl:template match=
"UML:Namespace.ownedElement">
37 <xsl:comment>Stereotypes
</xsl:comment>
38 <xsl:copy-of select=
"UML:Stereotype"/>
39 <xsl:comment>Stereotypes
</xsl:comment>
40 <xsl:comment>Datatypes
</xsl:comment>
41 <xsl:copy-of select=
"UML:DataType"/>
42 <xsl:comment>Datatypes
</xsl:comment>
43 <xsl:comment>Tag definitions
</xsl:comment>
44 <xsl:copy-of select=
"UML:TagDefinition"/>
45 <xsl:comment>Tag definitions
</xsl:comment>
46 <xsl:comment>Classes without stereotype
</xsl:comment>
47 <xsl:apply-templates select=
"UML:Class[count(./UML:ModelElement.stereotype) = 0]"/>
48 <xsl:comment>Classes without stereotype
</xsl:comment>
49 <xsl:comment>Resources
</xsl:comment>
50 <xsl:copy-of select=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='resource']"/>
51 <xsl:comment>Resources
</xsl:comment>
52 <xsl:comment>WW8 resources
</xsl:comment>
53 <xsl:apply-templates select=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8resource' and count(UML:ModelElement.stereotype/UML:Stereotype[@xmi.idref='ww8sprm']) = 0]"/>
54 <xsl:comment>WW8 resources
</xsl:comment>
55 <xsl:comment>SPRMS
</xsl:comment>
56 <xsl:apply-templates select=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm']"/>
57 <xsl:comment>SPRMS
</xsl:comment>
58 <xsl:comment>DFFS
</xsl:comment>
59 <xsl:apply-templates select=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffrecord']"/>
60 <xsl:comment>DFFS
</xsl:comment>
61 <xsl:comment>DFFOPT
</xsl:comment>
62 <xsl:apply-templates select=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']"/>
63 <xsl:comment>DFFOPT
</xsl:comment>
66 <xsl:key name=
"generalization" match=
"UML:Generalization"
67 use=
"UML:Generalization.child/UML:Class/@xmi.idref"/>
69 <xsl:template match=
"UML:Class[count(UML:ModelElement.stereotype) = 0]">
70 <xsl:variable name=
"theid"><xsl:value-of select=
"@xmi.id"/></xsl:variable>
71 <xsl:comment>Class
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
72 <xsl:copy-of select=
"."/>
73 <xsl:copy-of select=
"key('generalization', $theid)"/>
74 <xsl:comment>Class
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
77 <xsl:template match=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8resource' and count(UML:ModelElement.stereotype/UML:Stereotype[@xmi.idref='ww8sprm']) = 0]">
78 <xsl:variable name=
"theid"><xsl:value-of select=
"@xmi.id"/></xsl:variable>
79 <xsl:comment>Class
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
80 <xsl:copy-of select=
"."/>
81 <xsl:copy-of select=
"key('generalization', $theid)"/>
82 <xsl:comment>Class
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
85 <xsl:template match=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm']">
86 <xsl:variable name=
"theid"><xsl:value-of select=
"@xmi.id"/></xsl:variable>
87 <xsl:comment>SPRM
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
88 <xsl:copy-of select=
"."/>
89 <xsl:copy-of select=
"key('generalization', $theid)"/>
90 <xsl:comment>SPRM
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
93 <xsl:template match=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffrecord']">
94 <xsl:variable name=
"theid"><xsl:value-of select=
"@xmi.id"/></xsl:variable>
95 <xsl:comment>DFF
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
96 <xsl:copy-of select=
"."/>
97 <xsl:copy-of select=
"key('generalization', $theid)"/>
98 <xsl:comment>DFF
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
101 <xsl:template match=
"UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']">
102 <xsl:variable name=
"theid"><xsl:value-of select=
"@xmi.id"/></xsl:variable>
103 <xsl:comment>DFFOPT
<xsl:value-of select=
"@xmi.id"/></xsl:comment>
104 <xsl:copy-of select=
"."/>
105 <xsl:copy-of select=
"key('generalization', $theid)"/>
106 <xsl:comment>DFFOPT
<xsl:value-of select=
"@xmi.id"/></xsl:comment>