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

Re: Selecting a descendant child at arbitrary depth

Subject: Re: Selecting a descendant child at arbitrary depth
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Mar 2001 09:57:38 +0000
Re:  Selecting a descendant child at arbitrary depth
Hi Peter,

> Now, I have invented a tag called <docBody> which surrounds the
> XHTML that I am actually interested in. What I want to do is copy
> the contents of the <docBody> to the output, but ignore anything
> else that surrounds it:

It should work if you just have:

  <xsl:template match="mainDisplay">
    <xsl:copy-of select=".//docBody/*" />
  </xsl:template>

If that doesn't work, then I'd suspect a namespace issue (i.e. the
docBody in the source XML is actually in a default namespace but
you're trying to find one in the null namespace).  Either that or the
docBody doesn't have any element content - you might try:

  <xsl:template match="mainDisplay">
    <xsl:copy-of select=".//docBody/node()" />
  </xsl:template>

instead.

Or, possibly, you have some other template around that's matching the
docBody with greater priority.  If you use the above you'll get round
that - as long as the mainDisplay template matches then the copy
should be made.

I hope that helps,

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.