【发布时间】:2016-02-27 12:54:41
【问题描述】:
我的 XSLT 中大多有这样的语句:
<RealisationRelation name=''
xmi.id="{concat($serverxmiid, ':', $infraservicexmiid)}"
xmi.type='I'
from="{$serverxmiid}"
to="{$infraservicexmiid}" />
这不是那么冗长且更易于阅读。但是我该如何创建这样一个简单的语句而不是一个冗长的语句呢?
<xsl:element name="AccessRelation">
<xsl:attribute name="name">
<xsl:text></xsl:text>
</xsl:attribute>
<xsl:attribute name="xmi.id">
<xsl:value-of select="concat( $infraservicexmiid, ':', $artifactxmiid)"/>
</xsl:attribute>
<xsl:attribute name="xmi.type">
<xsl:text>I</xsl:text>
</xsl:attribute>
<xsl:attribute name="from">
<xsl:value-of select="$infraservicexmiid"/>
</xsl:attribute>
<xsl:attribute name="to">
<xsl:value-of select="$artifactxmiid"/>
</xsl:attribute>
<MM_Profile>
<xsl:attribute name="name">
<xsl:text>AccessRelation</xsl:text>
</xsl:attribute>
</MM_Profile>
<MM_Value>
<xsl:attribute name="name">
<xsl:text>accessType</xsl:text>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:text>w</xsl:text>
</xsl:attribute>
</MM_Value>
</xsl:element>
我想知道如何以不那么冗长的形式获得这些 MM_Profile 和 MM_Value 部分。其他都很简单。
【问题讨论】: