RE: [xsl] Help! How do I find elements through text contents XSLT 1.0

Subject: RE: [xsl] 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
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: [xsl] 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