This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Testing for certain combinations
- To: "Neil Abraham" <mylists at neilabraham dot co dot uk>
- Subject: Re: [xsl] Testing for certain combinations
- From: Jeni Tennison <jeni at jenitennison dot com>
- Date: Thu, 8 Nov 2001 13:09:08 +0000
- CC: XSL-List at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <004201c16853$19ecad00$0164a8c0@wsnet>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Neil,
> I need a way of testing whether or not I have 3 or more <a> links
> separated only by <br/> tags within a <p>.
Given the current node is a p element, perhaps something like:
not(text()[normalize-space()]) and
a[3] and br[3] and
not(a[following-sibling::*[1][not(self::br)]])
This would return true for a p element if:
- it doesn't contain text that contains anything other than whitespace
- it has at least three a and br element children
- all its a element children's immediately following siblings are br
elements
> 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.
Sounds as though it would be easier if you changed the XML so that
it's more content-oriented. If it looked like:
<links>
<link href="urlwhatever">Labelwhatever</link>
...
</links>
then you could transform it easily both into the WML and HTML (or
whatever) formats.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list