summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-04 21:10:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-04 21:28:30 +0100
commit45c5124e0e117473a9f423ccc673a8a26ee5fc9d (patch)
treefecd133de9d905a48e77e00bf65a0ff7434f360f /writerfilter
parent71b8dba74d176aa468fc74678f1073eb238db13b (diff)
writerfilter: drop ww8resource annotation in doctok
This was used as a tag for various classes, but the generated result wasn't used anywhere, so let's just get rid of it. Change-Id: I61dc51368177eddb6d04dba94063ba102f4ca1e5
Diffstat (limited to 'writerfilter')
-rwxr-xr-xwriterfilter/source/doctok/cleanupresources22
-rw-r--r--writerfilter/source/doctok/compactxmi.xsl262
-rw-r--r--writerfilter/source/doctok/resources.xmi48
-rw-r--r--writerfilter/source/doctok/resources.xsl289
-rw-r--r--writerfilter/source/doctok/resourcesimpl.xsl91
-rw-r--r--writerfilter/source/doctok/tidyxmi.xsl100
-rw-r--r--writerfilter/source/doctok/xmigen.xsl561
7 files changed, 0 insertions, 1373 deletions
diff --git a/writerfilter/source/doctok/cleanupresources b/writerfilter/source/doctok/cleanupresources
deleted file mode 100755
index a6177434b59e..000000000000
--- a/writerfilter/source/doctok/cleanupresources
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-TEMP=`mktemp -t cleanupresources`
-xsltproc tidyxmi.xsl resources.xmi | xmllint --format - > $TEMP
-mv $TEMP resources.xmi
diff --git a/writerfilter/source/doctok/compactxmi.xsl b/writerfilter/source/doctok/compactxmi.xsl
deleted file mode 100644
index 36ab4f5c5f9a..000000000000
--- a/writerfilter/source/doctok/compactxmi.xsl
+++ /dev/null
@@ -1,262 +0,0 @@
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:UML = 'org.omg.xmi.namespace.UML'
- xmlns:exslt="http://exslt.org/common"
- xml:space="default">
- <xsl:output method="xml"/>
-
- <xsl:template match="/">
- <xsl:apply-templates select="//UML:Model"/>
- </xsl:template>
-
- <xsl:template match="UML:Model">
- <model>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:call-template name="nostereotype"/>
- <xsl:call-template name="ww8resources"/>
- <xsl:call-template name="sprms"/>
- </model>
- </xsl:template>
-
- <xsl:template name="nostereotype">
- <xsl:for-each select="UML:Namespace.ownedElement/UML:Class[not(UML:ModelElement.stereotype)]">
- <xsl:variable name="myid" select="@xmi.id"/>
- <class>
- <xsl:attribute name="name">
- <xsl:value-of select="$myid"/>
- </xsl:attribute>
- <xsl:attribute name="resource">
- <xsl:for-each select="//UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$myid]">
- <xsl:value-of select="UML:Generalization.parent/UML:Class/@xmi.idref"/>
- </xsl:for-each>
- </xsl:attribute>
- <xsl:apply-templates select=".//UML:Attribute|.//UML:Operation" mode="ww8resource"/>
- </class>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="ww8resources">
- <xsl:for-each select="UML:Namespace.ownedElement/UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8resource' and not(UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm')]">
- <xsl:sort select="@xmi.id"/>
- <xsl:call-template name="ww8resource"/>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="ww8resource">
- <xsl:variable name="myid" select="@xmi.id"/>
- <xsl:variable name="classid">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">classid</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <ww8resource>
- <xsl:attribute name="name">
- <xsl:value-of select="$myid"/>
- </xsl:attribute>
- <xsl:attribute name="resource">
- <xsl:for-each select="//UML:Generalization[UML:Generalization.child/UML:Class/@xmi.idref=$myid]">
- <xsl:value-of select="UML:Generalization.parent/UML:Class/@xmi.idref"/>
- </xsl:for-each>
- </xsl:attribute>
- <xsl:if test="string-length($classid) &gt; 0">
- <xsl:attribute name="classid">
- <xsl:value-of select="$classid"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="UML:ModelElement.stereotype/UML:Stereotype">
- <xsl:if test="@xmi.idref != 'ww8resource'">
- <stereotype>
- <xsl:attribute name="name">
- <xsl:value-of select="@xmi.idref"/>
- </xsl:attribute>
- </stereotype>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select=".//UML:Attribute|.//UML:Operation" mode="ww8resource"/>
- </ww8resource>
- </xsl:template>
-
- <xsl:template name="gettaggedvalue">
- <xsl:param name="name"/>
- <xsl:for-each select="UML:ModelElement.taggedValue/UML:TaggedValue[UML:TaggedValue.type/UML:TagDefinition/@xmi.idref=$name]">
- <xsl:value-of select="UML:TaggedValue.dataValue"/>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="sizefortype">
- <xsl:param name="type"/>
- <xsl:choose>
- <xsl:when test="$type='S8'">1</xsl:when>
- <xsl:when test="$type='U8'">1</xsl:when>
- <xsl:when test="$type='S16'">2</xsl:when>
- <xsl:when test="$type='U16'">2</xsl:when>
- <xsl:when test="$type='S32'">4</xsl:when>
- <xsl:when test="$type='U32'">4</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="bits">
- <xsl:param name="bits"/>
- <bits>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="bits">
- <xsl:value-of select="$bits"/>
- </xsl:attribute>
- <xsl:attribute name="token">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">attrid</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </bits>
- </xsl:template>
-
- <xsl:template match="UML:Attribute" mode="ww8resource">
- <xsl:variable name="mask">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">mask</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="offset">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">offset</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="type">
- <xsl:value-of select="UML:StructuralFeature.type/UML:DataType/@xmi.idref"/>
- </xsl:variable>
- <xsl:variable name="size">
- <xsl:call-template name="sizefortype">
- <xsl:with-param name="type" select="$type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="arraycount">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">arraycount</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($mask) = 0">
- <attribute>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="type">
- <xsl:value-of select="$type"/>
- </xsl:attribute>
- <xsl:attribute name="size">
- <xsl:value-of select="$size"/>
- </xsl:attribute>
- <xsl:for-each select="UML:ModelElement.stereotype/UML:Stereotype[@xmi.idref='array']">
- <xsl:attribute name="array-count">
- <xsl:value-of select="$arraycount"/>
- </xsl:attribute>
- </xsl:for-each>
- <xsl:attribute name="token">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">attrid</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="attrswithoffset">
- <xsl:for-each select="ancestor::UML:Class//UML:Attribute[UML:ModelElement.taggedValue/UML:TaggedValue[UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='offset' and UML:TaggedValue.dataValue=$offset]]">
- <xsl:sort select="UML:ModelElement.taggedValue/UML:TaggedValue[UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='shift']/UML:TaggedValue.dataValue" data-type="number" order="descending"/>
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:text>&#xa;</xsl:text>
- <xsl:if test="@name = exslt:node-set($attrswithoffset)/UML:Attribute[1]/@name">
- <bitfield>
- <xsl:attribute name="size">
- <xsl:value-of select="$size"/>
- </xsl:attribute>
- <xsl:attribute name="type">
- <xsl:value-of select="$type"/>
- </xsl:attribute>
- <xsl:variable name="allbits" select="8 * $size"/>
- <xsl:for-each select="exslt:node-set($attrswithoffset)/UML:Attribute">
- <xsl:variable name="lastshift">
- <xsl:choose>
- <xsl:when test="count(preceding-sibling::UML:Attribute) = 0">
- <xsl:value-of select="$allbits"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="preceding-sibling::UML:Attribute[1]/UML:ModelElement.taggedValue/UML:TaggedValue[UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='shift']/UML:TaggedValue.dataValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="bits" select="$lastshift - UML:ModelElement.taggedValue/UML:TaggedValue[UML:TaggedValue.type/UML:TagDefinition/@xmi.idref='shift']/UML:TaggedValue.dataValue"/>
- <xsl:call-template name="bits">
- <xsl:with-param name="bits" select="$bits"/>
- </xsl:call-template>
- </xsl:for-each>
- </bitfield>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="UML:Operation" mode="ww8resource">
- <operation>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="type">
- <xsl:for-each select="UML:BehavioralFeature.parameter/UML:Parameter[@kind='return']">
- <xsl:value-of select="UML:Parameter.type/UML:Class/@xmi.idref"/>
- </xsl:for-each>
- </xsl:attribute>
- <xsl:attribute name="token">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">opid</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:for-each select="UML:ModelElement.stereotype">
- <stereotype>
- <xsl:value-of select="UML:Stereotype/@xmi.idref"/>
- </stereotype>
- </xsl:for-each>
- </operation>
- </xsl:template>
-
- <xsl:template match="*" mode="ww8resources">
- <xsl:apply-templates select="*" mode="ww8resources"/>
- </xsl:template>
-
- <xsl:template name="sprms">
- <xsl:for-each select="UML:Namespace.ownedElement/UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm']">
- <xsl:sort select="@xmi.id"/>
- <sprm>
- <xsl:attribute name="name">
- <xsl:value-of select="@xmi.id"/>
- </xsl:attribute>
- <xsl:attribute name="code">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">sprmcode</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="kind">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">kind</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="token">
- <xsl:call-template name="gettaggedvalue">
- <xsl:with-param name="name">sprmid</xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:if test="UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8resource'">
- <xsl:apply-templates select=".//UML:Attribute|.//UML:Operation" mode="ww8resource"/>
- </xsl:if>
- </sprm>
- </xsl:for-each>
- </xsl:template>
-
-</xsl:stylesheet> \ No newline at end of file
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index 96f39e61d825..04b17ff99945 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -28,9 +28,6 @@
<UML:Stereotype xmi.id="resource" name="resource">
<UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>
</UML:Stereotype>
- <UML:Stereotype xmi.id="ww8resource" name="ww8resource">
- <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>
- </UML:Stereotype>
<UML:Stereotype xmi.id="ww8sprm" name="ww8sprm">
<UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>
</UML:Stereotype>
@@ -23715,9 +23712,6 @@
<!--Class LineProps-->
<!--Class TBD-->
<UML:Class xmi.id="TBD" name="TBD">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:Classifier.feature>
<UML:Attribute name="jc">
<UML:ModelElement.taggedValue>
@@ -23914,9 +23908,6 @@
<!--Class TBD-->
<!--Class METAFILEPICT-->
<UML:Class xmi.id="METAFILEPICT" name="METAFILEPICT">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:Classifier.feature>
<UML:Attribute name="mm">
<UML:ModelElement.taggedValue>
@@ -26150,9 +26141,6 @@
<!--Class FSPA-->
<!--Class FLD-->
<UML:Class xmi.id="FLD" name="FLD">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>2</UML:TaggedValue.dataValue>
@@ -26365,9 +26353,6 @@
<!--Class FLD-->
<!--Class Rectangle-->
<UML:Class xmi.id="Rectangle" name="Rectangle">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>16</UML:TaggedValue.dataValue>
@@ -26941,9 +26926,6 @@
<!--Class FOPTE-->
<!--Class FDGG-->
<UML:Class xmi.id="FDGG" name="FDGG">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>16</UML:TaggedValue.dataValue>
@@ -27196,9 +27178,6 @@
<!--Class FDGG-->
<!--Class FIDCL-->
<UML:Class xmi.id="FIDCL" name="FIDCL">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>4</UML:TaggedValue.dataValue>
@@ -27335,9 +27314,6 @@
<!--Class FIDCL-->
<!--Class FBSE-->
<UML:Class xmi.id="FBSE" name="FBSE">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>0x24</UML:TaggedValue.dataValue>
@@ -28004,9 +27980,6 @@
<!--Class FBSE-->
<!--Class FRD-->
<UML:Class xmi.id="FRD" name="FRD">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>2</UML:TaggedValue.dataValue>
@@ -28427,9 +28400,6 @@
<!--Class ATRD-->
<!--Class FTXBXS-->
<UML:Class xmi.id="FTXBXS" name="FTXBXS">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>22</UML:TaggedValue.dataValue>
@@ -28860,9 +28830,6 @@
<!--Class FTXBXS-->
<!--Class FDG-->
<UML:Class xmi.id="FDG" name="FDG">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:Classifier.feature>
<UML:Attribute name="csp">
<UML:ModelElement.taggedValue>
@@ -28991,9 +28958,6 @@
<!--Class FDG-->
<!--Class Tplc-->
<UML:Class xmi.id="Tplc" name="Tplc">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>4</UML:TaggedValue.dataValue>
@@ -31581,9 +31545,6 @@
<UML:ModelElement.stereotype>
<UML:Stereotype xmi.idref="ww8sprm"/>
</UML:ModelElement.stereotype>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>0x6A03</UML:TaggedValue.dataValue>
@@ -31836,9 +31797,6 @@
<UML:ModelElement.stereotype>
<UML:Stereotype xmi.idref="ww8sprm"/>
</UML:ModelElement.stereotype>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>0x6A09</UML:TaggedValue.dataValue>
@@ -36498,9 +36456,6 @@
</UML:TaggedValue.type>
</UML:TaggedValue>
</UML:ModelElement.taggedValue>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:Classifier.feature>
<UML:Attribute name="itl">
<UML:ModelElement.taggedValue>
@@ -40137,9 +40092,6 @@
<UML:ModelElement.stereotype>
<UML:Stereotype xmi.idref="ww8sprm"/>
</UML:ModelElement.stereotype>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue>
<UML:TaggedValue.dataValue>0xF618</UML:TaggedValue.dataValue>
diff --git a/writerfilter/source/doctok/resources.xsl b/writerfilter/source/doctok/resources.xsl
index 204b2c7ed366..f23db05f63b1 100644
--- a/writerfilter/source/doctok/resources.xsl
+++ b/writerfilter/source/doctok/resources.xsl
@@ -68,300 +68,11 @@ OUString getDffOptName(sal_uInt32 nPid);
<xsl:template match="UML:Class" mode="class">
<xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8resource"]'>
- <xsl:apply-templates select="." mode="ww8resource"/>
- </xsl:when>
<xsl:when test='.//UML:Stereotype[@xmi.idref = "dffrecord"]'>
<xsl:apply-templates select="." mode="dffrecord"/>
</xsl:when>
</xsl:choose>
</xsl:template>
-
- <xsl:template match="UML:Class" mode="ww8resource">
- <xsl:variable name="parentresource">
- <xsl:call-template name='parenttype'>
- <xsl:with-param name='type'><xsl:value-of select='@xmi.id'/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='size_'><xsl:value-of select='./*/UML:TaggedValue[./*/UML:TagDefinition/@xmi.idref="size"]/UML:TaggedValue.dataValue'/></xsl:variable>
- <xsl:variable name='size'>
- <xsl:choose>
- <xsl:when test='$size_ != ""'><xsl:value-of select='$size_'/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="classname">WW8<xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="superclass">
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8sprm"]'>WW8PropertyImpl</xsl:when>
- <xsl:otherwise>WW8StructBase</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="surroundclass">
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8sprm"]'>WW8PropertyImpl</xsl:when>
- <xsl:otherwise>WW8StructBase</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>
-/**
- Automatically generated class: </xsl:text><xsl:value-of select="@name"/><xsl:text>
- </xsl:text>
- <xsl:for-each select='./UML:ModelElement.stereotype/UML:Stereotype'>
- <xsl:text>
- Stereotype </xsl:text>
- <xsl:value-of select='@xmi.idref'/>
- <xsl:text>&#xa;</xsl:text>
- </xsl:for-each>
- <xsl:text>
- Parent Resource: </xsl:text>
- <xsl:value-of select="$parentresource"/>
- <xsl:text>
- Size: </xsl:text><xsl:value-of select='$size'/>
- <xsl:text>
-*/
-class </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>: public </xsl:text>
- <xsl:value-of select='$superclass'/>
- <xsl:if test='$parentresource != ""'>
- <xsl:text>, public writerfilter::Reference&lt; </xsl:text>
- <xsl:value-of select='$parentresource'/>
- <xsl:text>&gt;</xsl:text>
- </xsl:if>
- <xsl:text>
-{</xsl:text>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text> sal_uInt32 mnIndex;</xsl:text>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withmembers"]'>
- <xsl:for-each select='.//UML:Attribute[@name!="reserved"]'>
- <xsl:apply-templates select='.' mode='declmembers'/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="needsdocument"]'>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="plcf"]'>
- <xsl:text>
- sal_uInt32 mnPlcfPayloadOffset;
- vector&lt;sal_uInt32&gt; entryOffsets;
- vector&lt;sal_uInt32&gt; payloadOffsets;
- vector&lt;sal_uInt32&gt; payloadIndices;
- </xsl:text>
- </xsl:if>
- <xsl:text>
- public:
- typedef boost::shared_ptr&lt;</xsl:text>
- <xsl:value-of select='$classname'/>
- <xsl:text>&gt; Pointer_t;
-
- </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>(
- WW8Stream &amp; rStream,
- sal_uInt32 nOffset = 0,
- sal_uInt32 nCount = </xsl:text>
- <xsl:value-of select='$size'/>
- <xsl:text>)
- : </xsl:text><xsl:value-of select='$superclass'/>
- <xsl:text>(rStream, nOffset, nCount)</xsl:text>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text>, mnIndex(0)</xsl:text>
- </xsl:if>
- <xsl:text>
- {
- }
- </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>(
- WW8StructBase * pParent,
- sal_uInt32 nOffset = 0,
- sal_uInt32 nCount = </xsl:text>
- <xsl:value-of select='$size'/>
- <xsl:text>)
- : </xsl:text>
- <xsl:value-of select='$superclass'/>
- <xsl:text>(pParent, nOffset, nCount)</xsl:text>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text>, mnIndex(0)</xsl:text>
- </xsl:if>
- <xsl:text>
- {
- }&#xa; </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>( const </xsl:text>
- <xsl:value-of select='$surroundclass'/>
- <xsl:text>&amp; rSurround,
- sal_uInt32 nOffset = 0, sal_uInt32 nCount = </xsl:text>
- <xsl:value-of select='$size'/>)
- <xsl:text>
- : </xsl:text>
- <xsl:value-of select='$superclass'/>
- <xsl:text>(rSurround, nOffset, nCount)</xsl:text>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text>, mnIndex(0)</xsl:text>
- </xsl:if>
- <xsl:text>
- {
- }&#xa;
- </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>(
- const Sequence &amp;
- rSequence, sal_uInt32 nOffset = 0,
- sal_uInt32 nCount = </xsl:text>
- <xsl:value-of select='$size'/>
- <xsl:text>)
- : </xsl:text>
- <xsl:value-of select='$superclass'/>
- <xsl:text>(rSequence, nOffset, nCount)</xsl:text>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text>, mnIndex(0)</xsl:text>
- </xsl:if>
- <xsl:text>
- {
- }
-
- virtual ~</xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>();&#xa;</xsl:text>
- <xsl:text>
-
- /**
- Return type of resource.
- */
- virtual string getType() const
- {
- return "</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>";
- }
-
- /**
- Return static size.
- */
- static sal_uInt32 getSize() { return </xsl:text>
- <xsl:value-of select='$size'/>
- <xsl:text>; }</xsl:text>
- <xsl:if test="not(.//UML:Stereotype[@xmi.ref='ww8nocalcsize'])">
- <xsl:text>
- /**
- Calculate actual size.
- */
- sal_uInt32 calcSize();
- </xsl:text>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="plcf"]'>
- <xsl:text>
- /**
- Return offset for entry of PLCF.
-
- @param nIndex index of entry
- */
- sal_uInt32 getEntryOffset(sal_uInt32 nIndex)
- {
- return entryOffsets[nIndex];
- }</xsl:text>
- <xsl:if test="not(.//UML:Stereotype[@xmi.idref='ww8nopayloadoffset'])">
- <xsl:text>
- /**
- Calculate offset for payload.
- */
- sal_uInt32 calcPayloadOffset();</xsl:text>
- </xsl:if>
- <xsl:text>
- /**
- Set offset for payloads.
-
- @param nOffset the offset to set
- */
- void setPayloadOffset(sal_uInt32 nOffset)
- {
- mnPlcfPayloadOffset = nOffset;
- }
-
- /**
- Return offset for payload of PLCF.
-
- @param nIndex index of entry
- */
- sal_uInt32 getPayloadOffset(sal_uInt32 nIndex)
- {
- return payloadOffsets[nIndex];
- }
-
- /**
- Return size of payload.
- */
- sal_uInt32 getPayloadSize(sal_uInt32 nIndex) const
- {
- return payloadOffsets[nIndex + 1] - payloadOffsets[nIndex];
- }
-
-
- /**
- Return payload index of an entry.
-
- */
- sal_uInt32 getPayloadIndex(sal_uInt32 nIndex)
- {
- return payloadIndices[nIndex];
- }
- </xsl:text>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="withindex"]'>
- <xsl:text>
- /**
- Set index in parent.
-
- @param nIndex the index
- */
- void setIndex(sal_uInt32 nIndex) { mnIndex = nIndex; }
- </xsl:text>
- </xsl:if>
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="ww8sprm"]'>
- <xsl:variable name='propsreftype'>writerfilter::Reference &lt; Properties &gt;::Pointer_t</xsl:variable>
- <xsl:text> /**
- Return reference to properties of Sprm.
- */
- </xsl:text>
- <xsl:value-of select='$propsreftype'/>
- <xsl:text> getProps()
- {
- return </xsl:text>
- <xsl:value-of select='$propsreftype'/>
- <xsl:text> (new </xsl:text>
- <xsl:value-of select='$classname'/>
- <xsl:text>(*this));
- }
- </xsl:text>
- </xsl:if>
-
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="ww8sprmbinary"]'>
- <xsl:text>
- virtual writerfilter::Reference &lt; BinaryObj &gt; ::Pointer_t getBinary();
- </xsl:text>
- </xsl:if>
-
- <xsl:if test='.//UML:Stereotype[@xmi.idref ="needsdocument"]'>
- </xsl:if>
- <xsl:apply-templates select="." mode="declsProperties"/>
- <xsl:if test='$parentresource="Table"'>
- <xsl:apply-templates select="." mode="declsTable"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$parentresource="Properties"'>
- <xsl:apply-templates select="." mode="resolveProperties"/>
- </xsl:when>
- <xsl:when test='$parentresource="Table"'>
- <xsl:apply-templates select="." mode="resolveTable"/>
- </xsl:when>
- </xsl:choose>
- <xsl:text>
- };
- </xsl:text>
- </xsl:template>
-
<xsl:template match='UML:Class' mode='declsProperties'>
<xsl:choose>
<xsl:when test='.//UML:Stereotype[@xmi.idref ="withmembers"]'>
diff --git a/writerfilter/source/doctok/resourcesimpl.xsl b/writerfilter/source/doctok/resourcesimpl.xsl
index f38458293aad..5c80b74b1a06 100644
--- a/writerfilter/source/doctok/resourcesimpl.xsl
+++ b/writerfilter/source/doctok/resourcesimpl.xsl
@@ -51,84 +51,6 @@ using namespace ::std;
</xsl:template>
<xsl:template match="UML:Class" mode="class">
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8resource"]'>
- <xsl:apply-templates select="." mode="ww8resource">
- <xsl:with-param name="classprefix">WW8</xsl:with-param>
- <xsl:with-param name="needsinit">true</xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="UML:Class" mode="ww8resource">
- <xsl:param name="classprefix"/>
- <xsl:param name="needsinit"/>
- <xsl:variable name="parentresource">
- <xsl:call-template name='parenttype'>
- <xsl:with-param name='type'><xsl:value-of select='@xmi.id'/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='size_'><xsl:value-of select='./*/UML:TaggedValue[./*/UML:TagDefinition/@xmi.idref="size"]/UML:TaggedValue.dataValue'/></xsl:variable>
- <xsl:variable name='size'>
- <xsl:choose>
- <xsl:when test='$size_ != ""'><xsl:value-of select='$size_'/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="classname"><xsl:value-of select="$classprefix"/><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="superclass">
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8sprm"]'>WW8PropertyImpl</xsl:when>
- <xsl:otherwise>WW8StructBase</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="surroundclass">
- <xsl:choose>
- <xsl:when test='.//UML:Stereotype[@xmi.idref = "ww8sprm"]'>WW8PropertyImpl</xsl:when>
- <xsl:otherwise>WW8StructBase</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>
-/*
- Automatically generated class: </xsl:text><xsl:value-of select="@name"/><xsl:text>
- </xsl:text>
- <xsl:for-each select='./UML:ModelElement.stereotype/UML:Stereotype'>
- <xsl:text>
- Stereotype </xsl:text>
- <xsl:value-of select='@xmi.idref'/>
- <xsl:text>&#xa;</xsl:text>
- </xsl:for-each>
- <xsl:text>
- Parent Resource: </xsl:text>
- <xsl:value-of select="$parentresource"/>
- <xsl:text>
- Size: </xsl:text><xsl:value-of select='$size'/>
- <xsl:text>
-*/
- </xsl:text>
-
- <xsl:value-of select="$classname"/>
- <xsl:text>::~</xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:text>()
- {
- }
- </xsl:text>
-
- <xsl:choose>
- <xsl:when test='$parentresource="Properties"'>
- <xsl:apply-templates select="." mode="resolveProperties">
- <xsl:with-param name="classname" select="$classname"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='$parentresource="Table"'>
- <xsl:apply-templates select="." mode="resolveTable">
- <xsl:with-param name="classname" select="$classname"/>
- </xsl:apply-templates>
- </xsl:when>
- </xsl:choose>
-
</xsl:template>
<xsl:template match="UML:Class" mode="resolveProperties">
@@ -150,19 +72,6 @@ using namespace ::std;
</xsl:when>
</xsl:choose>
</xsl:variable>
- <xsl:text>
- void </xsl:text>
- <xsl:value-of select="$classname"/>
- <xsl:choose>
- <xsl:when test=".//UML:Stereotype[@xmi.idref='ww8resource']">
- <xsl:text>::resolve(Properties &amp; </xsl:text>
- <xsl:text>)</xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:text>
- {
- }
- </xsl:text>
</xsl:template>
<xsl:template match='UML:Attribute' mode='resolveAttribute'>
diff --git a/writerfilter/source/doctok/tidyxmi.xsl b/writerfilter/source/doctok/tidyxmi.xsl
deleted file mode 100644
index 58e6eccd417e..000000000000
--- a/writerfilter/source/doctok/tidyxmi.xsl
+++ /dev/null
@@ -1,100 +0,0 @@
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:UML = 'org.omg.xmi.namespace.UML' xml:space="default">
-<xsl:output indent="yes"/>
-<xsl:template match="/">
-<XMI xmi.version="1.2">
- <XMI.header>
- <XMI.documentation/>
- </XMI.header>
- <XMI.content>
- <UML:Model xmlns:UML="org.omg.xmi.namespace.UML" name="WW8Document" >
- <UML:Namespace.ownedElement>
- <xsl:apply-templates select="XMI/XMI.content/UML:Model/UML:Namespace.ownedElement"/>
- </UML:Namespace.ownedElement>
- </UML:Model>
- </XMI.content>
-</XMI>
-
-</xsl:template>
-
-<xsl:template match="UML:Namespace.ownedElement">
- <xsl:comment>Stereotypes </xsl:comment>
- <xsl:copy-of select="UML:Stereotype"/>
- <xsl:comment>Stereotypes</xsl:comment>
- <xsl:comment>Datatypes </xsl:comment>
- <xsl:copy-of select="UML:DataType"/>
- <xsl:comment>Datatypes</xsl:comment>
- <xsl:comment>Tag definitions </xsl:comment>
- <xsl:copy-of select="UML:TagDefinition"/>
- <xsl:comment>Tag definitions </xsl:comment>
- <xsl:comment>Classes without stereotype</xsl:comment>
- <xsl:apply-templates select="UML:Class[count(./UML:ModelElement.stereotype) = 0]"/>
- <xsl:comment>Classes without stereotype</xsl:comment>
- <xsl:comment>Resources</xsl:comment>
- <xsl:copy-of select="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='resource']"/>
- <xsl:comment>Resources</xsl:comment>
- <xsl:comment>WW8 resources</xsl:comment>
- <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]"/>
- <xsl:comment>WW8 resources</xsl:comment>
- <xsl:comment>SPRMS</xsl:comment>
- <xsl:apply-templates select="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm']"/>
- <xsl:comment>SPRMS</xsl:comment>
- <xsl:comment>DFFS</xsl:comment>
- <xsl:comment>DFFS</xsl:comment>
- <xsl:comment>DFFOPT</xsl:comment>
- <xsl:apply-templates select="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']"/>
- <xsl:comment>DFFOPT</xsl:comment>
-</xsl:template>
-
-<xsl:key name="generalization" match="UML:Generalization"
- use="UML:Generalization.child/UML:Class/@xmi.idref"/>
-
-<xsl:template match="UML:Class[count(UML:ModelElement.stereotype) = 0]">
- <xsl:variable name="theid"><xsl:value-of select="@xmi.id"/></xsl:variable>
- <xsl:comment>Class <xsl:value-of select="@xmi.id"/></xsl:comment>
- <xsl:copy-of select="."/>
- <xsl:copy-of select="key('generalization', $theid)"/>
- <xsl:comment>Class <xsl:value-of select="@xmi.id"/></xsl:comment>
-</xsl:template>
-
-<xsl:template match="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8resource' and count(UML:ModelElement.stereotype/UML:Stereotype[@xmi.idref='ww8sprm']) = 0]">
- <xsl:variable name="theid"><xsl:value-of select="@xmi.id"/></xsl:variable>
- <xsl:comment>Class <xsl:value-of select="@xmi.id"/></xsl:comment>
- <xsl:copy-of select="."/>
- <xsl:copy-of select="key('generalization', $theid)"/>
- <xsl:comment>Class <xsl:value-of select="@xmi.id"/></xsl:comment>
-</xsl:template>
-
-<xsl:template match="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='ww8sprm']">
- <xsl:variable name="theid"><xsl:value-of select="@xmi.id"/></xsl:variable>
- <xsl:comment>SPRM <xsl:value-of select="@xmi.id"/></xsl:comment>
- <xsl:copy-of select="."/>
- <xsl:copy-of select="key('generalization', $theid)"/>
- <xsl:comment>SPRM <xsl:value-of select="@xmi.id"/></xsl:comment>
-</xsl:template>
-
-<xsl:template match="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref='dffopt']">
- <xsl:variable name="theid"><xsl:value-of select="@xmi.id"/></xsl:variable>
- <xsl:comment>DFFOPT <xsl:value-of select="@xmi.id"/></xsl:comment>
- <xsl:copy-of select="."/>
- <xsl:copy-of select="key('generalization', $theid)"/>
- <xsl:comment>DFFOPT <xsl:value-of select="@xmi.id"/></xsl:comment>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/writerfilter/source/doctok/xmigen.xsl b/writerfilter/source/doctok/xmigen.xsl
deleted file mode 100644
index 749d70b3faa3..000000000000
--- a/writerfilter/source/doctok/xmigen.xsl
+++ /dev/null
@@ -1,561 +0,0 @@
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
--->
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:UML = 'org.omg.xmi.namespace.UML'
- xml:space="default">
- <xsl:output method="xml"/>
-
- <xsl:template match="/">
- <out>
- <xsl:apply-templates select="*"/>
- </out>
- </xsl:template>
-
- <xsl:template name="calcsizeinner">
- <xsl:param name="size">0</xsl:param>
- <xsl:variable name="arraycount">
- <xsl:choose>
- <xsl:when test="@array-count">
- <xsl:value-of select="@array-count"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="mysize">
- <xsl:choose>
- <xsl:when test="@size and not(@offset)">
- <xsl:value-of select="number($arraycount) * number(@size)"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:for-each select="following-sibling::*[1]">
- <xsl:call-template name="calcsizeinner">
- <xsl:with-param name="size"
- select="number($size) + number($mysize)"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($size) + number($mysize)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="calcsize">
- <xsl:for-each select="*[1]">
- <xsl:call-template name="calcsizeinner"/>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="calcoffsetinner">
- <xsl:variable name="arraycount">
- <xsl:choose>
- <xsl:when test="@array-count">
- <xsl:value-of select="@array-count"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="mysize">
- <xsl:choose>
- <xsl:when test="@size and not(@offset)">
- <xsl:value-of select="number($arraycount) * number(@size)"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="preceding-sibling::*">
- <xsl:variable name="precedingoffset">
- <xsl:for-each select="preceding-sibling::*[1]">
- <xsl:call-template name="calcoffsetinner"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="number($precedingoffset) + number($mysize)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$mysize"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="calcoffset">
- <xsl:choose>
- <xsl:when test="@offset">
- <xsl:value-of select="@offset"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="preceding-sibling::*[1]">
- <xsl:call-template name="calcoffsetinner"/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="ww8resource">
- <UML:Class>
- <xsl:attribute name="xmi.id">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
- <xsl:for-each select="stereotype">
- <UML:ModelElement.stereotype>
- <UML:Stereotype>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- </UML:Stereotype>
- </UML:ModelElement.stereotype>
- </xsl:for-each>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:call-template name="calcsize"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="size"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
-
- <xsl:apply-templates select="*"/>
-
- </UML:Class>
- <UML:Generalization isSpecification="false">
- <xsl:attribute name="xmi.id">
- <xsl:value-of select="@name"/>
- <xsl:text>-</xsl:text>
- <xsl:value-of select="@resource"/>
- </xsl:attribute>
- <UML:Generalization.child>
- <UML:Class>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- </UML:Class>
- </UML:Generalization.child>
- <UML:Generalization.parent>
- <UML:Class xmi.idref="Properties">
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="@resource"/>
- </xsl:attribute>
- </UML:Class>
- </UML:Generalization.parent>
- </UML:Generalization>
- </xsl:template>
-
- <xsl:template match="sprm">
- <xsl:variable name="isww8resource">
- <xsl:choose>
- <xsl:when test="count(*) > 0">YES</xsl:when>
- <xsl:otherwise>NO</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <UML:Class>
- <xsl:attribute name="xmi.id">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:if test="$isww8resource='YES'">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8resource"/>
- </UML:ModelElement.stereotype>
- </xsl:if>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="ww8sprm"/>
- </UML:ModelElement.stereotype>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">sprmcode</xsl:with-param>
- <xsl:with-param name="value" select="@code"/>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">sprmid</xsl:with-param>
- <xsl:with-param name="value" select="@token"/>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">kind</xsl:with-param>
- <xsl:with-param name="value" select="@kind"/>
- </xsl:call-template>
- <xsl:apply-templates select="*"/>
- </UML:Class>
- <xsl:if test="$isww8resource='YES'">
- <xsl:call-template name="generalization">
- <xsl:with-param name="parent">Properties</xsl:with-param>
- <xsl:with-param name="child" select="@name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="generalization">
- <xsl:param name="parent"/>
- <xsl:param name="child"/>
- <UML:Generalization isSpecification="false">
- <xsl:attribute name="xmi.id">
- <xsl:value-of select="$child"/>
- <xsl:text>-</xsl:text>
- <xsl:value-of select="$parent"/>
- </xsl:attribute>
- <UML:Generalization.child>
- <UML:Class>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="$child"/>
- </xsl:attribute>
- </UML:Class>
- </UML:Generalization.child>
- <UML:Generalization.parent>
- <UML:Class xmi.idref="Properties">
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="$parent"/>
- </xsl:attribute>
- </UML:Class>
- </UML:Generalization.parent>
- </UML:Generalization>
- </xsl:template>
-
- <xsl:template name="taggedvalue">
- <xsl:param name="type"/>
- <xsl:param name="value"/>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:value-of select="$value"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="$type"/>
- </xsl:attribute>
- </UML:TagDefinition>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- </xsl:template>
-
- <xsl:template match="attribute">
- <UML:Classifier.feature>
- <UML:Attribute>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">comment</xsl:with-param>
- <xsl:with-param name="value"/>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">offset</xsl:with-param>
- <xsl:with-param name="value">
- <xsl:call-template name="calcoffset"/>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">shift</xsl:with-param>
- <xsl:with-param name="value"></xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">mask</xsl:with-param>
- <xsl:with-param name="value"></xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">bits</xsl:with-param>
- <xsl:with-param name="value"></xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">attrid</xsl:with-param>
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="@token">
- <xsl:value-of select="@token"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>rtf:</xsl:text>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:if test="@array-count">
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">arraycount</xsl:with-param>
- <xsl:with-param name="value">
- <xsl:value-of select="@array-count"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <UML:StructuralFeature.type>
- <UML:DataType>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="@type"/>
- </xsl:attribute>
- </UML:DataType>
- </UML:StructuralFeature.type>
- <xsl:choose>
- <xsl:when test="@array-count">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="array"/>
- </UML:ModelElement.stereotype>
- </xsl:when>
- <xsl:otherwise>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="attribute"/>
- </UML:ModelElement.stereotype>
- </xsl:otherwise>
- </xsl:choose>
- </UML:Attribute>
- </UML:Classifier.feature>
- </xsl:template>
-
- <xsl:template match="bitfield">
- <xsl:variable name="offset">
- <xsl:call-template name="calcoffset"/>
- </xsl:variable>
- <xsl:for-each select="bits">
- <xsl:call-template name="bits">
- <xsl:with-param name="offset" select="$offset"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="mask">
- <xsl:param name="count"/>
- <xsl:param name="value"/>
-
- <xsl:choose>
- <xsl:when test="number($count) = 1">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mask">
- <xsl:with-param name="count" select="number($count) - 1"/>
- <xsl:with-param name="value" select="number($value) * 2 + 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="shift">
- <xsl:param name="shift"/>
- <xsl:param name="value"/>
-
- <xsl:choose>
- <xsl:when test="number($shift) = 0">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="shift">
- <xsl:with-param name="shift" select="number($shift) - 1"/>
- <xsl:with-param name="value" select="$value * 2"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name='dectohex'>
- <xsl:param name="number"/>
- <xsl:if test="$number > 16">
- <xsl:call-template name="dectohex">
- <xsl:with-param name="number" select="floor($number div 16)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:value-of select="substring('0123456789abcdef', $number mod 16 + 1, 1)"/>
- </xsl:template>
-
- <xsl:template name="calcshift">
- <xsl:choose>
- <xsl:when test="@shift">
- <xsl:value-of select="@shift"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="sum(following-sibling::*[not (@shift)]/@bits)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="bits">
- <xsl:param name="offset"/>
- <xsl:variable name="shift">
- <xsl:call-template name="calcshift"/>
- </xsl:variable>
- <xsl:variable name="mask">
- <xsl:call-template name="mask">
- <xsl:with-param name="count" select="@bits"/>
- <xsl:with-param name="value" select="1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="maskshifted">
- <xsl:call-template name="shift">
- <xsl:with-param name="shift" select="$shift"/>
- <xsl:with-param name="value" select="$mask"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="maskhex">
- <xsl:text>0x</xsl:text>
- <xsl:call-template name="dectohex">
- <xsl:with-param name="number" select="$maskshifted"/>
- </xsl:call-template>
- </xsl:variable>
- <UML:Classifier.feature>
- <UML:Attribute>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue/>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="comment"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:value-of select="$offset"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="offset"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:value-of select="$shift"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="shift"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:value-of select="$maskhex"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="mask"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:value-of select="@bits"/>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="bits"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:ModelElement.taggedValue>
- <UML:TaggedValue>
- <UML:TaggedValue.dataValue>
- <xsl:choose>
- <xsl:when test="@token">
- <xsl:value-of select="@token"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>rtf:</xsl:text>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </UML:TaggedValue.dataValue>
- <UML:TaggedValue.type>
- <UML:TagDefinition xmi.idref="attrid"/>
- </UML:TaggedValue.type>
- </UML:TaggedValue>
- </UML:ModelElement.taggedValue>
- <UML:StructuralFeature.type>
- <UML:DataType>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="ancestor::bitfield/@type"/>
- </xsl:attribute>
- </UML:DataType>
- </UML:StructuralFeature.type>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="attribute"/>
- </UML:ModelElement.stereotype>
- </UML:Attribute>
- </UML:Classifier.feature>
- </xsl:template>
-
- <xsl:template match="operation">
- <UML:Classifier.feature>
- <UML:Operation>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">opid</xsl:with-param>
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="@token">
- <xsl:value-of select="@token"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>rtf:</xsl:text>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:if test="@array-count">
- <xsl:call-template name="taggedvalue">
- <xsl:with-param name="type">arraycount</xsl:with-param>
- <xsl:with-param name="value">
- <xsl:value-of select="@array-count"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <UML:BehavioralFeature.parameter>
- <UML:Parameter kind="return" name="return">
- <UML:Parameter.type>
- <UML:Class>
- <xsl:attribute name="xmi.idref">
- <xsl:value-of select="@type"/>
- </xsl:attribute>
- </UML:Class>
- </UML:Parameter.type>
- </UML:Parameter>
- </UML:BehavioralFeature.parameter>
- <xsl:choose>
- <xsl:when test="@array-count or stereotype[text()='array']">
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="array"/>
- </UML:ModelElement.stereotype>
- </xsl:when>
- <xsl:otherwise>
- <UML:ModelElement.stereotype>
- <UML:Stereotype xmi.idref="attribute"/>
- </UML:ModelElement.stereotype>
- </xsl:otherwise>
- </xsl:choose>
- </UML:Operation>
- </UML:Classifier.feature>
- </xsl:template>
-</xsl:stylesheet> \ No newline at end of file