[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
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: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 24 Jan 2008 14:18:44 GMT
|
> 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 |
- RE: [xsl] Adding Missing Element, (continued)
- Bjorndahl, Brad - Wed, 23 Jan 2008 17:58:43 -0500
- Marroc - Thu, 24 Jan 2008 12:32:44 -0000
- David Carlisle - Thu, 24 Jan 2008 12:50:33 GMT
- Marroc - Thu, 24 Jan 2008 13:57:04 -0000
- David Carlisle - Thu, 24 Jan 2008 14:18:44 GMT <=
- Marroc - Thu, 24 Jan 2008 14:28:41 -0000
- Andrew Welch - Thu, 24 Jan 2008 12:51:33 +0000
- Marroc - Thu, 24 Jan 2008 13:29:08 -0000
Marroc - Thu, 24 Jan 2008 14:16:38 -0000
|