AW: [xsl] WG: How to reorder an XML tree?

Subject: AW: [xsl] WG: How to reorder an XML tree?
From: "Griebel, Peer" <Peer.Griebel@xxxxxxxxx>
Date: Fri, 22 Jun 2001 10:30:50 +0200
> Von: Paul Prescod [mailto:paulp@xxxxxxxxxxxxxxx]
> Perhaps you could be more explicit in the description of your problem.
> Are you saying that the element with the id "b" should always 
> be moed to
> be a child of the element with the id "d" and everything else should
> remain the same? Should it be the first child, the last 
> child, the only
> child?

Sorry for not being precise.
Yes "b" should always moved to "d", the rest should remain the same. For my
problem it makes no difference for "b" being the first or the last child.

In the meantime I came to a solution. I think it's quite complicated.
Perhaps it should be possible to make it shorter. Especially the definition
of the xsl:key is a problem. I didn't manage to get 
			<xsl:template match="match="id('b')">
work. What am I doing wrong?
Thank you for your help!

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="";
  <xsl:output method="xml" indent="no"/>

  <xsl:key name="object" match="*" use="@id"/>

  <xsl:template match="key('object','b')">
  	<xsl:comment> Object b stripped </xsl:comment>

  <xsl:template match="key('object','b')" mode="copy">
	<xsl:comment> Object b copied here </xsl:comment>

  <xsl:template match="key('object','d')">
       select="key('object','b')" mode="copy"/>

  <xsl:template match="*|@*|comment()|processing-instruction()|text()">

connection reset by

Dr. Peer Griebel                     Tel: +49(0) 731 / 9 74 95-0
Dipl. Inform.                       Fax: +49(0) 731 / 9 74 95-20
Entire Software AG                 mailto:Peer.Griebel@xxxxxxxxx
Pfarrer-Weiß-Weg 10 - 12
D-89077 Ulm                       

 XSL-List info and archive:

Current Thread