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

Re: template question: copy-of and non-continuous chi

Subject: Re: template question: copy-of and non-continuous children and grandchildren
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 1 Mar 2002 17:29:51 +0000
Re:  template question: copy-of  and non-continuous chi
Hi Mike,

> I have a question about how I can call a template for children and
> grandchildren in as <xsl:copy-of select="node()"/>.
>
> I have been processing all C1007 nodes with a template. But these
> C1007 nodes occur at different levels of the C1009 node sometimes as
> great great grand children but all C1007 are within ITEM node.
>
> What do you think would be the best way to do this?

If you only want to apply templates to the C1007 elements, you can
step down to them with:

  <xsl:apply-templates select="ITEM/descendant::C1007" />

or, if you prefer:

  <xsl:apply-templates select="ITEM//C1007" />

So your template for the C1009 element would be:

<xsl:template match="C1009">
  <NOTE ENCODINGANALOG="{@LINK}">
    <LIST>
      <xsl:apply-templates select="ITEM//C1007" />
    </LIST>
  </NOTE>
</xsl:template>

This would give you a NOTE element, with a LIST element inside it, and
within that the NOTE and P elements generated by the template for the
C1007 element, one for each of the C1007 elements in the source
document, no matter what level they were at within the C1009 element.

Is that what you were after?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.