|
Subject: [xsl] Re: Problem with not() function. From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Tue, 9 Oct 2001 00:03:07 -0700 (PDT) |
> I meet a problem when use not function in the xsl. I use not function in the >
> select statement
> to filter out some node.
>
> The code is :
>
> ...
> ...
> <xsl:template match="sub-title">
> <xsl:apply-templates select="*[not(self::para[1]) and not(self::title) and
> not(self::graphic[1])]" />
> </xsl:template>
> ...
> ...
>
> i need to filter out the para[1] node , the title node and the graphic[1] node.
>
> the xml is :
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Document>
> ...
> ...
> <sub-title>
> <title>"Bluetooth" Wireless Home Control Center</title>
> <para>Some text here 1.</para>
> <para>some text here 2.</para>
> <para>some text here 3.</para>
>
> <graphic>
> <title/>
> <pic><para>pic/eln/bluetooth01.jpg</para></pic>
> </graphic>
> </sub-title>
> ...
> ...
> </Document>
self::anyName[1] is always true, so not(self::anyName[1]) will always return false.
What you probably wanted is:
*[not(self::title
or self::para and not(preceding-sibling::para)
or self::graphic and not(preceding-sibling::graphic))]
Cheers,
Dimitre Novatchev.
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Problem with not() functi, Jarno . Elovirta | Thread | [xsl] Overlapping structures, Stuart Brown |
| RE: [xsl] Problem with not() functi, Jarno . Elovirta | Date | RE: [xsl] running saxon on commandl, Sakaama Heesakkers |
| Month |