[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|