This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Exclude elements from apply-templates?




> ><xsl:apply-templates select="*[not(self::title) or not(name()=subtitle)]"/>

> For some reason <title> (not <subtitle>) turns up a second time, if I write
> this exactly

You were supposed to write what Joerg meant not what he wrote.
name()=subtitle 
tests teh name f the current element against the string value of its
child subtitle element. 
name()='subtitle'
was intended which tests the name of teh current element against the
string 'subtitle'.
it's better to use the self::subtitle form though ratherthan using
name() as it's shorter, likely to be a bit quicker (if not noticeable)
and more importantly it works correctly with namespaces, which name()
does not.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]