Using the following Axis

The following axis contains all nodes that are after the context node in document order (in other words, in the order in which they appear in the document, starting at the beginning of the document), excluding any of the context node’s descendants and also excluding attribute nodes and namespace nodes.

In this example I match each <PLANET> element and copy all the following elements to the result document:

Listing 7.8. Using the following Axis
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:output method="xml"/> 

<xsl:template match="PLANET"> 
    <xsl:for-each select="following::*"> 
        <xsl:copy-of select="."/> 
    </xsl:for-each> 
</xsl:template> 

</xsl:stylesheet> 

Here’s ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.