This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Selecting a descendant child at arbitrary depth
- To: "Peter McEvoy" <pmcevoy at iona dot com>
- Subject: Re: [xsl] Selecting a descendant child at arbitrary depth
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 14 Mar 2001 09:57:38 +0000
- CC: XSL-List at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <000401c0ac68$0ae32b10$6106020a@ZERO>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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