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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Help! How do I find eleme, Marroc | Thread | RE: [xsl] Help! How do I find eleme, Marroc |
[xsl] The identity transform and a, Marroc | Date | Re: [xsl] The identity transform an, Colin Adams |
Month |