Update: Cascade deletions with XSLT

Within the first 24 hours of posting Cascade deletions with XSLT,  David Carlisle came up with improved XSLT 2.0 solution (below). David’s solution main improvement is not so much in being just 37 lines long (3 lines down from the 40-line solution I originally posted) but in defining with an <xsl:key> all nodes to be deleted. So, the intersect operator from my solution is not used in David’s, which should translate in better speed. Thank you, David.


 Cascade deletions — XSLT 2 (David Carlisle)


<xsl:stylesheet version="2.0
 <xsl:output omit-xml-declaration="yes" indent="yes"/>
 <xsl:strip-space elements="*"/> 

 <xsl:key name="x" match="class

<xsl:key name="x" match="beast

<xsl:key name="beastbytype" match="beast

<xsl:key name="x" match="breed

<xsl:key name="breadbyname" match="breed

<xsl:key name="x" match="pet" use=

<xsl:template match="*">
   <xsl:copy-of select="@*"/>

<xsl:template match="key(‘x’,’Aves’)"/> 


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s