This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Testing for certain combinations
- To: <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] Testing for certain combinations
- From: "Neil Abraham" <mylists at neilabraham dot co dot uk>
- Date: Thu, 8 Nov 2001 12:44:25 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi all,
I need a way of testing whether or not I have 3 or more <a> links separated
only by <br/> tags within a <p>. This is hard to explain so here are some
examples:
This should test positive:
<p>
<a href="urlwhatever">Labelwhatever</a><br/>
<a href="urlwhatever">Labelwhatever</a><br/>
<a href="urlwhatever">Labelwhatever</a><br/>
</p>
This should test negative since there are only 2 links:
<p>
<a href="urlwhatever">Labelwhatever</a><br/>
<a href="urlwhatever">Labelwhatever</a><br/>
</p>
This should also test negative since it contains text outside of <a>:
<p>
See our great <a href="urlwhatever">products</a> or read
<a href="urlwhatever">about us</a>. Feel free to
<a href="urlwhatever">contact us</a> any time.
</p>
For those interested, I'm developing a stylesheet to transform our XML into
WML for UP browsers. The UP browser (eg Siemens and Motorola phones)
displays option lists better than link lists. Eg:
<select>
<option onpick="urlwhatever">Labelwhatever</option>
<option onpick="urlwhatever">Labelwhatever</option>
<option onpick="urlwhatever">Labelwhatever</option>
</select>
Thanks in advance for any help you can give me,
Neil.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list