xsl-list
[Top] [All Lists]

RE: generic sort based on attribute names

2005-01-25 13:09:23
I want this to be generic. 
The tag/attribute names are not known. The 'e' was just part of the example. 
Thanks 

-----Original Message-----
From: Joris Gillis [mailto:roac(_at_)pandora(_dot_)be] 
Sent: Tuesday, January 25, 2005 9:04 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] generic sort based on attribute names

Tempore 01:45:12, die 01/25/2005 AD, hinc in  
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Chaitanya Desai  
<cdesai(_at_)syncata(_dot_)com>:

Can u please explain how the node-set function could help in this
context?
Sure...

In stead of the the clumsy 'substring()' approach, you could use a result  
tree fragment, given that you have got an extension function that can  
convert it to a node-set.

e.g.
<xsl:sort  
select="xx:node-set($sortkey)//e[position()=count(current()/preceding-sibling::e)]"/>

with this template:
<xsl:template match="e" mode="sortkey">
<e>
<xsl:apply-templates select="@*" mode="sortkey">
<xsl:sort select="." data-type="string"/>
</xsl:apply-templates>
</e>
</xsl:template>

(not tested)


regards,
-- 
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"Φιλήκοον ειναι μαλλον η φιλόλαλον"  -  
Κλεόβουλος

--~------------------------------------------------------------------
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>
--~--