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

Re: How to select text only for element with mixed content?

Subject: Re: How to select text only for element with mixed content?
From: Nick Browne <NickBrowne@xxxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 21:39:21 +0100
xml mixed complex mixed gettext
Use the text() method for the element(s) in question, i.e. <xsl:value-of
select="Tagx.x/text()"/>

My preference is to always use this rather than rely on the default. The
default (to get text of all related descendants) is fine provided you can
guarantee that no child elements with text will be added to your XML
structure at a later point.

Nick Browne
Slipstone Ltd

X Line wrote:

> I was wondering if there are any kind folks who might
> wish to help a newbie with this problem. I have
> an element whose content model is comprised of
> child elements as well as cdata. The child
> elements in turn contain cdata (and possibly
> children of their own).
>
> Eg:
>
> <Tag1>
>    <Tag2>
>       <Tag2.1>Text for Tag2.1</Tag2.1>
>       This is text for Tag2
>    </Tag2>
>
>    <Tag3>This is text for Tag3</Tag3>
>
>    This is text for Tag1
> </Tag1>
>
> Assuming I have a template for Tag1 in an XSL
> stylysheet, and I am currently processing that
> template, I wish to extract only the text for
> Tag1 (and not the pcdata for the children).
> i.e.: "This is text for Tag1

etc.


 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.