This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how to rearrange nodes based on a dependency graph?
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 20 Dec 2001 23:49:31 -0000
- Subject: RE: [xsl] how to rearrange nodes based on a dependency graph?
- Reply-to: xsl-list at lists dot mulberrytech dot com
Ok what about (and I am getting rather blind here)
<xsl:template match="/">
<xsl:variable name="allIdsUsed" select="//frag[@requires]">
<xsl:for-each select="@requires">
<ids><xsl:value-of select="." /></ids>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="xx:node-set($allIdsUsed)/ids">
<xsl:copy-of select="//frag[@id = .]" />
</xsl:for-each>
<xsl:copy-of select="//frag[@requires]" />
</xsl:template>
This only works if you can get all of the ids out of the @requires idref
but like I said I don't use them. If it doesn't then you wil have to
split the @requires into the <ids /> somehow.
Ciao Chris
Forget the bacardi I'm on the red bulls
XML/XSL Portal
http://www.bayes.co.uk/xml
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list