selecting nodes between other nodes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Timo Nentwig

    selecting nodes between other nodes

    Hi!

    <root>
    <foo>bar</foor>
    <blah />
    <blah2 />
    <a>
    <b />
    <c />
    </>
    </root>

    I want to select everything between <foo> and <a>. Is this possible?

    Timo
  • Patrick TJ McPhee

    #2
    Re: selecting nodes between other nodes

    In article <2jbjjhFvf4ttU1 @uni-berlin.de>,
    Timo Nentwig <tcn@spamgourme t.org> wrote:
    % <root>
    % <foo>bar</foor>
    % <blah />
    % <blah2 />
    % <a>
    % <b />
    % <c />
    % </>
    % </root>

    % I want to select everything between <foo> and <a>. Is this possible?

    How about

    <xsl:styleshe et xmlns:xsl = 'http://www.w3.org/1999/XSL/Transform'
    version = '1.0'>

    <xsl:template match='*[preceding-sibling::foo and following-sibling::a]'>
    <xsl:copy-of select = '.'/>
    </xsl:template>

    <xsl:template match='text()'/>
    </xsl:stylesheet>


    ?
    --

    Patrick TJ McPhee
    East York Canada
    ptjm@interlog.c om

    Comment

    Working...