xsl-list
[Top] [All Lists]

[xsl] Next node outside of axis pattern

2009-07-17 18:25:41
Hello everyone and thanks in advance for any help. If I had an XML
like the following (snippet tried to cover off most scenarios):

<?xml version="1.0"?>
<root>
        <a>This is some text</a>
        <s>
                <section>
                        <toc>Heading 1</toc>
                        <p>This is<endofpage num="1"/> a paragraph</p>
                        <p>This is a paragraph</p>
                </section>
                <section>
                        <toc>Heading 2</toc>
                        <p>This is a paragraph</p>
                </section>
                <section>
                        <p>This is a paragraph</p>
                        <p>This<endofpage num="2"/> is a paragraph</p>
                        <li>
                                <p>This is a paragraph</p>
                                <p>This is a paragraph</p>
                        </li>
                </section>
                <section>
                        <toc>Heading 3</toc>
                        <p>This is a paragraph</p>
                </section>
        </s>
        <a>This<endofpage num="3"/> is some more text</a>
        <p>This is a paragraph</p>
</root>

the <endofpage> element can appear anywhere within the document in an
element that contains text. The issues is building a table of contents
of the <toc> elements. For <toc>Heading 1</toc> no problem using
descendant axis. However with Heading 2 and Heading 3 I can't figure
out how to get the page number. I'm looking for something like:

<xsl:template match="toc">
<p><xsl:value-of select="."/> ......... <!-- next endofpage/@num goes
here --></p>
</xsl:template>


Any thoughts?

Thanks,

Spencer

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