This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
sort by attribute text
- From: Mike Ferrando <mikeferrando at yahoo dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 26 Mar 2002 09:42:04 -0800 (PST)
- Subject: [xsl] sort by attribute text
- Reply-to: xsl-list at lists dot mulberrytech dot com
Dear Friends,
I am suffering from a long night with my 5 year old who has strep.
Can someone have mercy on me and help me out with this dumb-dumb
question?
I just want to sort the elements of different names with different
attribute names by a substring in the attribute text (a number).
code below
thanks,
Mike F.
My XSL:
<xsl:template match="*">
<xsl:for-each select=".">
<xsl:sort select="@*[substring-after(., 'rr_target_2')]"
data-type="number"/>
</xsl:for-each>
</xsl:template>
My XML:
<C ID="rr_target2_33">data...</C>
<C ID="rr_target2_34">data...</C>
<R TAR="rr_target2_33">data...</R>
<R TAR="rr_target2_34">data...</R>
What I would like in my output:
<C ID="rr_target2_33">data...</C>
<R TAR="rr_target2_33">data...</R>
<C ID="rr_target2_34">data...</C>
<R TAR="rr_target2_34">data...</R>
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list