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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top