W
WideBoy
Hi,
I would like to sort and unique a list of elements that I extract from
an XMI file.
My xslt script successfully sorts the data but I need help in creating
a unique list.
A fragment of my xslt looks like this:
...
<xsl:template name="ExtractDTs">
<xsl:for-each select="/XMI/XMI.content/UML:Model/
UML:Namespace.ownedElement/UMLataType/@name">
<xsl:sort data-type="text" order="ascending"/>
<xsl:choose>
<xsl:when test="fn:ends-with(.,'Amount')">
<xs:simpleType name="{.}">
<xs:restriction base="global.Amount"/>
</xs:simpleType>
</xsl:when>
<xsl:when test="fn:ends-with(.,'List')">
<xs:simpleType name="{.}">
<xs:restriction base="global.CV"/>
</xs:simpleType>
</xsl:when>
....
<xsltherwise/>
</xsl:choose>
</xsl:for-each>
</xsl:template>
Any help or advice would be much appreciated.
Naran
I would like to sort and unique a list of elements that I extract from
an XMI file.
My xslt script successfully sorts the data but I need help in creating
a unique list.
A fragment of my xslt looks like this:
...
<xsl:template name="ExtractDTs">
<xsl:for-each select="/XMI/XMI.content/UML:Model/
UML:Namespace.ownedElement/UMLataType/@name">
<xsl:sort data-type="text" order="ascending"/>
<xsl:choose>
<xsl:when test="fn:ends-with(.,'Amount')">
<xs:simpleType name="{.}">
<xs:restriction base="global.Amount"/>
</xs:simpleType>
</xsl:when>
<xsl:when test="fn:ends-with(.,'List')">
<xs:simpleType name="{.}">
<xs:restriction base="global.CV"/>
</xs:simpleType>
</xsl:when>
....
<xsltherwise/>
</xsl:choose>
</xsl:for-each>
</xsl:template>
Any help or advice would be much appreciated.
Naran