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

Re: copying child nodes n-level deep

Subject: Re: copying child nodes n-level deep
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Jul 2001 16:58:45 +0200 (MET DST)
Re:  copying  child nodes n-level deep
What about

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

Cheers,
Oliver

You wrote:
> Given:
> <A>
>   <B>
>     <C id="1">
>       <D id1="2">
>         <E>hello</E>
>       </D>
>     </C>
>   </B>
> </A>
> 
> I would like to copy all the elements and their children starting from D.
> The logic is, take the grand-child of B (in this case D) and copy it (along
> with all its children). The only known element name is B..How can I write a
> generic xsl code such that from the following schema:
> 
> <AA>
>   <B>
>     <CC id="1">
>       <DD id1="2">
>         <EE>hello</EE>
>         <FF>hello2</FF>
>       </DD>
>     </CC>
>   </B>
> </AA> 
> 
> I can copy (B's grand child (DD)  and its children):
>      <DD id1="2">
>         <EE>hello</EE>
>         <FF>hello2</FF>
>       </DD>
> 
> Thanks a lot for the help.

/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

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-2013 All Rights Reserved.