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

Re: Help! How do I find elements through text contents

Subject: Re: Help! How do I find elements through text contents XSLT 1.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 24 Jan 2008 14:18:44 GMT
Re:  Help! How do I find elements through text contents
> That is, I sometimes have extra <b> and <i> tags
They would not affect the string value of the surrounding td or th, so
the code I posted should work in those cases. to cope with tbody not
being there you could use
descendant::tr[1]/*[1]
ie, the first child of the first row.

<template match="body/table">
	<xsl:choose>	
		<xsl:when test="contains(.,'Keyword')">

if that's Ok that's OK (if expensive, working out the stribg value of
the whole table, and potentially unsafe unless you know that string
could not appear elsewhere (for example its a numeric table apart from
the heading)
 it works for the same reason my suggestion of using the
string value of the first child of the first tr, the string value of an
element is all its descendants text cointent.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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.