select="*" selects the element children only, you want select="node()" which
also selects the text nodes.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Spencer Tickner [mailto:spencertickner(_at_)gmail(_dot_)com]
Sent: 27 February 2006 18:26
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] selecting not(node()) not working as I expect it to
Hello everyone,
For some reason (Monday perhaps) I'm having a very difficult time with
a very simple concept. I'm simply trying to apply all templates except
a node and then apply that node and it's children. I've done this
before with no issue,, now, well I'm having issues.
xml
<?xml version="1.0"?>
<root>
<para>This is a paragraph</para>
<para>This is a paragraph
<list mark="bull">
<listitem>This
is a list</listitem>
<listitem>This
is a list</listitem>
</list></para>
<para>This is another paragraph</para>
</root>
xsl
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="para">
<p><xsl:apply-templates select="*[not(self::list)]"/></p>
<xsl:apply-templates select="list"/>
</xsl:template>
<xsl:template match="para/text()">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="list">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="listitem">
<li><xsl:apply-templates/></li>
</xsl:template>
expected output
<p>This is a paragraph</p>
<p>This is a paragraph</p>
<ul>
<li>This is a list</li>
<li>This is a list</li>
</ul>
<p>This is another paragraph</p>
what I'm getting
<p/>
<p/><ul>
<li>This is a list</li>
<li>This is a list</li>
</ul>
<p/>
any thoughts?
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--