I have a WordML document of which I would like to select a certain heading. WordML however only consists of paragraphs that follow eachother. A paragraph (<w
>) consists of paragraph properties (<w
Pr>) and text (<w:t>). A basic WordML document would look like this :
<w
>
<w
Pr>
<w
Style w:val="Heading1"/>
</w
Pr>
<w:r>
<w:t>
The first heading
</w:t>
</w:r>
</w
>
<w
>
<w:r>
<w:t>
The first paragraph after heading 1...
</w:t>
</w:r>
</w
>
<w
>
<w:r>
<w:t>
The 2nd paragraph after heading 1...
</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="Heading1"/>
</w
Pr>
<w:r>
<w:t>
The 2nd heading
</w:t>
</w:r>
</w
>
<w
>
<w:r>
<w:t>
The first paragraph after heading 2...
</w:t>
</w:r>
</w
>
<w
>
<w:r>
<w:t>
The 2nd paragraph after heading 2...
</w:t>
</w:r>
</w
>
What I need is an xslt that selects a heading and all the paragraphs that follow it until the next heading. So for heading 1 this xslt would show :
The first heading
The first paragraph after heading 1...
The 2nd paragraph after heading 1...
I'm a bit clueless on how to handle this. As far as I know there is nothing similar to 'until' or a boolean that can be set to true or false in xsl. How should I handle this problem ?
<w
<w
<w
</w
<w:r>
<w:t>
The first heading
</w:t>
</w:r>
</w
<w
<w:r>
<w:t>
The first paragraph after heading 1...
</w:t>
</w:r>
</w
<w
<w:r>
<w:t>
The 2nd paragraph after heading 1...
</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>
The 2nd heading
</w:t>
</w:r>
</w
<w
<w:r>
<w:t>
The first paragraph after heading 2...
</w:t>
</w:r>
</w
<w
<w:r>
<w:t>
The 2nd paragraph after heading 2...
</w:t>
</w:r>
</w
What I need is an xslt that selects a heading and all the paragraphs that follow it until the next heading. So for heading 1 this xslt would show :
The first heading
The first paragraph after heading 1...
The 2nd paragraph after heading 1...
I'm a bit clueless on how to handle this. As far as I know there is nothing similar to 'until' or a boolean that can be set to true or false in xsl. How should I handle this problem ?