selecting nodes between other nodes

T

Timo Nentwig

Hi!

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

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

Timo
 
P

Patrick TJ McPhee

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


?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top