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

RE: selecting with text nodes

Subject: RE: selecting with text nodes
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Thu, 2 May 2002 15:15:28 +0100
RE:  selecting with text nodes
Hi Ian,

>Hi,
>
>I am having a problems trying to select elements based on the text contents
>of child nodes. For example how would I convert [...]

What kind of problems are you having? In theory it should be as simple as
selecting elements on their attributes, which you say you can do fine.

Instead of testing for an attribute value in your predicate eg 
	element[@attribute='myValue']

you test for the value of the child element:
	element[childElement = 'myValue']

This is because the childElement element is converted into a string for the
purpose of the comparison. I suppose you could also do child/text() =
'myValue' or even normalize-space(child/text()), but start simple :)
 
nb once you start doing comparisons on a node's 'value' like this, be aware
that this value will depend on what it's being compared with. There's a
detailed section on this in Mike Kay's book.

regards,
Tom Weissmann

 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.