RE: [xsl] Grouping over multiple files

Subject: RE: [xsl] Grouping over multiple files
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Sat, 14 Jan 2006 22:52:33 +0100 (CET)
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 : tiliphonez moins cher avec Yahoo! Messenger ! Dicouvez les tarifs exceptionnels pour appeler la France et l'international.
Tilichargez sur http://fr.messenger.yahoo.com

Current Thread