-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
eas:getSlot aims to simplify access to slot values:
<xsl:function name="eas:getSlot" as="xs:string*">
<xsl:param name="instances" as="element(simple_instance)*"/>
<xsl:param name="slot" as="xs:string+"/>
<xsl:sequence select="$instances/own_slot_value[slot_reference=$slot]/value"/>
</xsl:function>
eas:getSlotInstance aims to simplify retrieval of a simple instance through slot value
<xsl:key name="allNodeKeys"
match="/node()/simple_instance"
use="./name"/>
<xsl:variable name="root" select="/node()"/>
<xsl:template mode="eas:getSlotInstance" match="*" as="element(simple_instance)*">
<xsl:param name="instance" as="element(simple_instance)*"/>
<xsl:param name="slot" as="xs:string+"/>
<xsl:sequence select="key('allNodeKeys',$instance/own_slot_value[slot_reference=$slot]/value)"/>
</xsl:template>
<xsl:function name="eas:getSlotInstance" as="element(simple_instance)*">
<xsl:param name="instance" as="element(simple_instance)*"/>
<xsl:param name="slot" as="xs:string+"/>
<xsl:variable name="result" as="element(simple_instance)*">
<xsl:apply-templates mode="eas:getSlotInstance" select="$root">
<xsl:with-param name="instance" select="$instance"/>
<xsl:with-param name="slot" select="$slot"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$result"/>
</xsl:function>
eas:getName (resp. eas:getDescription) returns the 'name' (resp. 'description) slot values:
<xsl:function name="eas:getName" as="xs:string*">
<xsl:param name="instance" as="element(simple_instance)*"/>
<xsl:value-of select="eas:getSlot($instance,'name')"/>
</xsl:function>
<xsl:function name="eas:getDescription" as="xs:string">
<xsl:param name="instance"/>
<xsl:value-of select="eas:getSlot($instance,'description')"/>
</xsl:function>
Metadata
Metadata
Assignees
Labels
No labels