xsl-list
[Top] [All Lists]

Re: [xsl] Numbering Consecutive Nodes

2006-05-31 04:11:32


        <xsl:template match="PageContent//node()">

I don't think that you want to match _all_ nodes below PageContent This
would include text nodes comments and anything else. If you apply
templates to any text node this template will generate an error as
                <xsl:copy>
will copy the text node but then        <xsl:attribute name="id">
will try to make an attribute on a text node which obviously isn't
allowed. Change node() to * in the match pattern.

By default xsl:number just counts children of the current parent you want
<xsl:number level="any"/>

                <xsl:apply-templates
select="PageContent//node()" />

This selects all descendents of the PageContent child of the current
node. However the current node (which is a descendent of PageContent)
has no PageContent child so this will select nothing.

You just want
<xsl:apply-templates/>
here the default behaviour of just processing the child nodes is what
you want. (Lower descendendts will be recursively processed when the
templates matching the child nodes are executed.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>