trying to build an xpath query...

  • Thread starter Michael Dahlquist
  • Start date
M

Michael Dahlquist

Hi -

I've got a nasty XML file that reads something like this:

<a>
<b>text</b>
<c>text</c>
<d>
<e></e>
<e></e>
</d>
<c>text</c>
<b>text</b>
<f>text</f>
<c>text</c>
<b>text</b>
</a>

Each <b> element represents a new section. I need to process one
section at a time - each <b> element is a heading, and everything
between <b> elements becomes a separate document. Each section may
include both descendants and siblings of the <b> element.

The only way I've been able to make this work is to edit the source
XML so that there's a wrapper around each section, starting after each
<b> element, ending just before the next <b> element.

I want to say, "for every <b> element, apply a transformation to
everything between this <b> element and the next <b> element."

Is this possible? Should I send more information? Am I barking up the
wrong tree?

Let me know, thanks -

Michael
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top