[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|