📄 xmi.xsl
字号:
<xsl:apply-templates select=".."/>
</xsl:for-each>
</xsl:template>
<!-- format each parameter -->
<xsl:template match="Foundation.Core.Parameter">
<xsl:if test="Foundation.Core.Parameter.kind[@xmi.value='inout']">
<b>var </b>
</xsl:if>
<xsl:if test="Foundation.Core.Parameter.kind[@xmi.value='out']">
<b>out </b>
</xsl:if>
<xsl:if test="not(Foundation.Core.Parameter.kind[@xmi.value='return'])">
<xsl:copy-of select="Foundation.Core.ModelElement.name" />
</xsl:if>
<xsl:apply-templates select="Foundation.Core.Parameter.type"/>
<xsl:apply-templates select="Foundation.Core.Parameter.defaultValue"/>
</xsl:template>
<!-- here different formats for the components of parameters -->
<xsl:template match="Foundation.Core.Parameter.type">
:
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Foundation.Core.Parameter.defaultValue">
<xsl:if test="Foundation.Data_Types.Expression/Foundation.Data_Types.Expression.body!=''">
=
<xsl:apply-templates />
</xsl:if>
</xsl:template>
<xsl:template match="Foundation.Core.Parameter.Expression">
<xsl:for-each select="Foundation.Core.Parameter.Expression.body">
<xsl:apply-templates />
</xsl:for-each>
</xsl:template>
<xsl:template match="Foundation.Data_Types.Expression">
<xsl:for-each select="Foundation.Data_Types.Expression.body">
<xsl:apply-templates />
</xsl:for-each>
</xsl:template>
<xsl:template match="Foundation.Core.Parameter.type/Foundation.Core.Classifier">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:template>
<!-- opens the block of a package/module or creates a reference to it -->
<xsl:template match="Model_Management.Package">
<div style="background-color:green; color:black; margin-left:10px">
<xsl:choose>
<xsl:when test="@xmi.id != ''">
<a><xsl:attribute name="name"><xsl:value-of select="@xmi.id" /></xsl:attribute><b>Package:</b> </a>
</xsl:when>
<xsl:otherwise>
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>Package</a>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates />
</div>
</xsl:template>
<!-- Foundation.Core.Usage not used by ESS
associations are not exported by ESS
ArgoUML uses it -->
<xsl:template match="Foundation.Core.Usage[@xmi.id]">
<div style="background-color:red; color:yellow; margin-left:10px">
<a><xsl:attribute name="name"><xsl:value-of select="@xmi.id" /></xsl:attribute><b>Usage: </b></a>
<xsl:for-each select="Foundation.Core.Dependency.client/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
<b> uses </b>
<xsl:for-each select="Foundation.Core.Dependency.supplier/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
</div>
</xsl:template>
<!-- used for the class and interface hierarchie; parent and subclasses
in declaration uses Foundation.Core.Generalization.child and Foundation.Core.Generalization.parent
in references Foundation.Core.Generalization.specialization and Foundation.Core.Generalization.generalization
ESS uses in declaration Foundation.Core.Class and probably Foundation.Core.Interface
ArgoUML uses Foundation.Core.GeneralizableElement -->
<xsl:template match="Foundation.Core.Generalization[@xmi.id]">
<div style="background-color:black; color:white; margin-left:10px">
<b>
<a><xsl:attribute name="name"><xsl:value-of select="@xmi.id" /></xsl:attribute><b>Generalization: </b></a>
<xsl:for-each select="Foundation.Core.Generalization.parent/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
<b> is subclassed by </b>
<xsl:for-each select="Foundation.Core.Generalization.child/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
</b>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.GeneralizableElement.generalization/Foundation.Core.Generalization[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Specialization of: </b>
<xsl:variable name="genid" select="@xmi.idref" />
<xsl:for-each select="/descendant::Foundation.Core.Generalization[@xmi.id=$genid]/Foundation.Core.Generalization.parent/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.GeneralizableElement.specialization/Foundation.Core.Generalization[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Specialized by: </b>
<xsl:variable name="genid" select="@xmi.idref" />
<xsl:for-each select="/descendant::Foundation.Core.Generalization[@xmi.id=$genid]/Foundation.Core.Generalization.child/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
</div>
</xsl:template>
<!-- used for classes implementing interfaces
in declaration uses Foundation.Core.Dependency.client and Foundation.Core.Dependency.supplier
in references Foundation.Core.ModelElement.clientDependency and Foundation.Core.ModelElement.supplierDependency
ESS uses in declaration Foundation.Core.Class and Foundation.Core.Interface
ArgoUML uses Foundation.Core.ModelElement -->
<xsl:template match="Foundation.Core.Abstraction[@xmi.id]">
<div style="background-color:black; color:white; margin-left:10px">
<b>
<a><xsl:attribute name="name"><xsl:value-of select="@xmi.id" /></xsl:attribute><b>Abstraction: </b></a>
<xsl:for-each select="Foundation.Core.Dependency.client/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
<b> implements </b>
<xsl:for-each select="Foundation.Core.Dependency.supplier/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref" />
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name" />
</a>
</xsl:for-each>
</b>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.ModelElement.clientDependency/Foundation.Core.Dependency[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Implements: </b>
<xsl:variable name="idabs" select="@xmi.idref"/>
<xsl:for-each select="/descendant::Foundation.Core.Abstraction[@xmi.id=$idabs]/Foundation.Core.Dependency.supplier/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref"/>
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name"/>
</a>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.ModelElement.clientDependency/Foundation.Core.Abstraction[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Implements: </b>
<xsl:variable name="idabs" select="@xmi.idref"/>
<xsl:for-each select="/descendant::Foundation.Core.Abstraction[@xmi.id=$idabs]/Foundation.Core.Dependency.supplier/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref"/>
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name"/>
</a>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.ModelElement.supplierDependency/Foundation.Core.Dependency[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Implemented by: </b>
<xsl:variable name="idabs" select="@xmi.idref" />
<xsl:for-each select="/descendant::Foundation.Core.Abstraction[@xmi.id=$idabs]/Foundation.Core.Dependency.client/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref"/>
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name"/>
</a>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="Foundation.Core.ModelElement.supplierDependency/Foundation.Core.Abstraction[@xmi.idref]">
<div style="background-color:black; color:white; margin-left:10px">
<b>Implemented by: </b>
<xsl:variable name="idabs" select="@xmi.idref" />
<xsl:for-each select="/descendant::Foundation.Core.Abstraction[@xmi.id=$idabs]/Foundation.Core.Dependency.client/*[@xmi.idref]">
<a><xsl:attribute name="href">#<xsl:value-of select="@xmi.idref" /></xsl:attribute>
<xsl:variable name="id" select="@xmi.idref"/>
<xsl:copy-of select="/descendant::*[@xmi.id=$id]/Foundation.Core.ModelElement.name"/>
</a>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -