[xslt] XPath predicate not working as expected



This isn't really a libxslt bug or problem (at this point), but I
figured this was the best place to start since I am using PHP5's XSL
extension, which is based on libxslt.

I have an XML document with a fragment that looks like this.

<para><bold>Text.</bold> More text.
<table attribute="value"><tbl.head>
<tbl.title>Title</tbl.title>
</tbl.head><two.col.tbl>
<two.cell.row>
<cell><bold>Data1</bold></cell>
<cell>Data2</cell></two.cell.row>
</two.col.tbl>
</table>
</para>

The para element may contain many different types of children, such as
bold, italic, super, etc.  I would like to get the value of para and all
its children's values except those of table.  My XPath query looks like
this.

<xsl:value-of select="descendant-or-self::*[not(self::table)]"/>

This however still selects the table and its children.  I have tried
variations including

<xsl:value-of
select="descendant-or-self::*[not(descendant-or-self::table)]"/>
and
<xsl:value-of select="descendant-or-self::*[not(descendant::table)]"/>
with no success.

I am using libxsl version 1.1.21 as a PHP5 extension (XSL extension).
Any ideas what I am doing wrong?  Thanks for your help.

-- 
Brian Morton
HowStuffWorks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]