Using XSL 1.0, I am trying to get the data between two "Section" elements. I have no trouble getting just the "Heading" information alone, but I'd also like to know what Section that falls between since they are not siblings. That's where I get screwed up.
I have searched the web and this forum for various solutions, mostly trying to generate a key and using grouping, but I have been unsuccessful in getting anything that works. Sometimes it's a "whitespace expected" error or nothing at all.
INPUT:
<Root>
<Content>
<Paragraph Type="New Section">
<Text>Section A</Text>
</Paragraph>
<Paragraph Type="Stuff">
<Text>Random information 1</Text>
</Paragraph>
<Paragraph Type="Heading">
<Text>Important information 1</Text>
</Paragraph>
<Paragraph Type="Stuff">
<Text>Random information 2</Text>
</Paragraph>
<Paragraph Type="Heading">
<Text>Important information 2</Text>
</Paragraph>
<Paragraph Type="End Of Section">
<Text>End of Section A</Text>
</Paragraph>
<Paragraph Type="New Section">
<Text>Section B</Text>
</Paragraph>
<Paragraph Type="Stuff">
<Text>Random information 3</Text>
</Paragraph>
<Paragraph Type="Heading">
<Text>Important information 3</Text>
</Paragraph>
<Paragraph Type="Stuff">
<Text>Random information 4</Text>
</Paragraph>
<Paragraph Type="Heading">
<Text>Important information 4</Text>
</Paragraph>
<Paragraph Type="End Of Section">
<Text>End of Section B</Text>
</Paragraph>
</Content>
</Root>
DESIRED OUTPUT:
"Important information 1"
"Section A"
"Important information 2"
"Section A"
"Important information 3"
"Section B"
"Important information 4"
"Section B"
As I mentioned, using a choose and when test against Paragraph/@Type = "Heading" I am able to get the "Important information" text, but I cannot figure out how to tell between which Sections they fall.
Thank you in advance.