This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
match selection formulae
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] match selection formulae
- From: roger dot day at globalgraphics dot com
- Date: Fri, 7 Sep 2001 09:58:01 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
I suspect that this is a newbie question, but I could nott find the answer in
the Big Red Book 2 or a trawl through the archives. I solved the problem in a
kludge-like manner but I'm interested in teh reasons -why- it failed.
I had a selection formula so;
<xsl:template match="lg[@type='stanza' | @rend='italic']">
</xsl:template>
<xsl:template match="lg[@type='stanza' | @rend='']">
</xsl:template>
In my naiveity, I thought that @rend='' would be the equivalent of testing for
the non-existence of an attribute - however, not(@rend) doesn't appear to work
either. I'm using Xalan 2. what's the correct way for testing for the
non-existence of an attribute (or an element come to that)?
More distressingly, the first template always got ignored, not matter what
pattern I tried with the second. Why did it fail?
I "solved" the problem with a choose element inside a template matched for
@type='stanza', but I'm interested on any solutions that would solve this
problem in a more elegant manner.
TIA
Roger
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list