[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Copy a node inside a template but exclude a deeply

Subject: RE: Copy a node inside a template but exclude a deeply nested child
From: "Adam Retter" <adam.retter@xxxxxxxxxxxx>
Date: Mon, 4 Sep 2006 16:17:52 +0100
bpel copy
Thanks Michael,

For completeness, I accomplished your code below by copying your two
templates into my xslt stylesheet and replacing -

<xsl:copy-of select="content/main/show/node()"/>

with -

<xsl:apply-templates mode="copy" select="content/main/show/node()"/>



It seems to work very well, hopefully that is as you described I should
do?


Cheers Adam.


-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Mon 9/4/2006 12:52 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Copy a node inside a template but exclude a deeply
nested child

> I have an existing xslt and in one of the templates it makes
> a copy of a node from the xml document, I now have the need
> to exclude a deeply nested child from that copy

You have to replace the xsl:copy-of with a recursive use of the identity
template:

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

<xsl:template match="element-to-be-excluded" mode="copy"/>

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.