xsl-list
[Top] [All Lists]

RE: [xsl] Reordering elements

2006-06-13 14:30:51
<xsl:template match="*">
  <xsl:copy>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="Root">
  <xsl:copy>
    <xsl:apply-templates select="*[not(self::Source)]"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="Story">
  <xsl:copy>
    <xsl:apply-templates select="following-sibling::Source"/>
    <xsl:apply-templates select="*"/>
  </xsl:copy>
</xsl:template>

Michael Kay
http://www.saxonica.com/


-----Original Message-----
From: Chad Chelius [mailto:cchelius(_at_)agitraining(_dot_)com] 
Sent: 13 June 2006 20:41
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Reordering elements


In a situation where my XML file looks like this:

<Root>
      <Story>
      <Source>
</Root>

How would I move the <Source> element so that and it's 
children are now a child of <Story>?


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



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

<Prev in Thread] Current Thread [Next in Thread>