Using XPath 1.0 and XSLT 1.0 I need to select direct parents of mixed content or just text. Consider the following example:
<table class="dont-match">
<tr class="dont-match">
<td class="match">Mixed <strong class="maybe-match">content</strong> in here.</td>
<td class="match">Plain text in here.</td>
<td class="dont-match"><img src="..." /></td>
</tr>
</table>
<div class="dont-match">
<div class="dont-match"><img src="..." /></div>
<div class="match">Mixed <em class="maybe-match">content</em> in here.</div>
<p class="match">Plain text in here.</p>
</div>
Obviously the classes match
, maybe-match
and dont-match
are just for demonstrating purpose and are not available for matching. maybe-match
means it was better not to match, but I could solve the problem my self, in case it is difficult to exclude these.
Many thanks in advance!