selecting nodes between other nodes

Discussion in 'XML' started by Timo Nentwig, Jun 16, 2004.

  1. Timo Nentwig

    Timo Nentwig Guest

    Hi!

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

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

    Timo
    Timo Nentwig, Jun 16, 2004
    #1
    1. Advertising

  2. In article <>,
    Timo Nentwig <> 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:stylesheet 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
    Patrick TJ McPhee, Jun 17, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gavnosis
    Replies:
    0
    Views:
    500
    gavnosis
    Aug 2, 2003
  2. Replies:
    2
    Views:
    379
  3. Yoav Shapira
    Replies:
    3
    Views:
    1,094
    Yoav Shapira
    Mar 8, 2006
  4. Replies:
    1
    Views:
    557
    Soren Kuula
    Aug 24, 2006
  5. cesarcesar

    Inserting Nodes between Nodes

    cesarcesar, Jan 21, 2008, in forum: XML
    Replies:
    4
    Views:
    371
    Joseph Kesselman
    Jan 22, 2008
Loading...

Share This Page