Michael Kay wrote:
Florent, would you be kind enough to explain the function.
Yes. But Michael did it better than me :-)
And as Michael said, in this case, you can directly cut what you want
in the document-uri.
I would personally be inclined to write it as
<xsl:function name="k:get-source" as="xs:string">
<xsl:param name="node" as="node()"/>
<xsl:variable name="root" as="node()" select="root($node)"/>
<xsl:sequence select='
for $i in 1 to 4 return
if (($north, $south, $east, $west)[$i] is $root)
then ("north", "south", "east", "west")[$i]
else ()'/>
</xsl:function>
Intresting. I'm used to use document trees in variables to simulate
randomly-accessed tables, indexed by strings for example. But here,
because the "index" (the thing to use as such) is a document node, I
didn't see how to don't use a choose. It's not really the same thing,
but it looks clearer and more compact than the choose.
Regards,
--drkm
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--