xsl-list
[Top] [All Lists]

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

2008-01-24 07:28:30
Thanks David, 

that has cracked it. I knew 'the dot' was unsafe and expensive - aren't so
many things in this world - but I was getting desperate to solve it. 

Thanks again,
Richard

-----Original Message-----
From: David Carlisle 

 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>