[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: "Marroc" <marrocdanderfluff@xxxxxxxxxxx>
Date: Thu, 24 Jan 2008 13:57:04 -0000
RE:  Help! How do I find elements through text contents
Thanks David, 

that reduces the number of permutations but doesn't solve the problem of
multiple levels. That is, I sometimes have extra <b> and <i> tags. Someone
used <tbody> where most did not. I'm looking for an easy way of getting to
the text() node at the end of a largely unknown path. The only thing I can
say for certain is that it is a table.

With further dabbling, I appear to have stumbled on a solution:

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

This looks through the whole table to find 'Keyword' irrespective of the
element names and returns true if it is found.

Richard

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx] 
Sent: 24 January 2008 12:51
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Help! How do I find elements through text contents XSLT
1.0


"contains(tr[1]/th[1],'Keyword')">
"contains(tr[1]/td[1],'Keyword')">


since a tr can/should only have td or th and you don't mond which it is, you
can probably just use 8
		

	<xsl:when test="contains(tr[1]/*[1],'Keyword')">

to do both cases at once.

David

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.