A
Andy
Hi
I'm having difficulties with positional grouping.
I have a wordML fragment that looks something like this:
<ns0:Body>
<w
>
<w
Pr>
<w
Style w:val="BodyHeading"/>
</w
Pr>
<w:r>
<w:t>Subject Matter</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="NumberedText"/>
</w
Pr>
<w:r>
<w:t>Some list text</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="Text"/>
</w
Pr>
<w:r>
<w:t>Some text</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="BodyHeading"/>
</w
Pr>
<w:r>
<w:t>Subject Matter 2</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="Text"/>
</w
Pr>
<w:r>
<w:t>Some more text</w:t>
</w:r>
</w
>
<w
>
<w
Pr>
<w
Style w:val="NumberedText"/>
</w
Pr>
<w:r>
<w:t>Some more list text</w:t>
</w:r>
</w
>
</ns0:Body>
I need to transform this XML into another XML Schema format which
requires paragraphs in the "Body" to be structured in this way
<Body>
<Section>
<Title>Subject Matter</Title>
<List>
<ListItem>Some list text</List>
</List>
<Para>Some text</Para>
</Section>
<Section>
<Title>Subject Matter 2</Title>
<Para>Some more text</Para>
<List>
<ListItem>Some more list text</List>
</List>
</Section>
</Body>
I have no control over the number of paragraphs that the Body will
contain and I think I need to use the w
Style attribute to identify
which paragraphs need to become Section headings. As you can see all
the paragraphs after a BodyHeading paragraph need to be children of the
BodyHeading paragraph (which becomes a <Section>) until another
BodyHeading is found at which time the process starts again.
I am using XSL version 1.0 and am in big trouble.
Can anyone help.
I'm having difficulties with positional grouping.
I have a wordML fragment that looks something like this:
<ns0:Body>
<w
<w
<w
</w
<w:r>
<w:t>Subject Matter</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>Some list text</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>Some text</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>Subject Matter 2</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>Some more text</w:t>
</w:r>
</w
<w
<w
<w
</w
<w:r>
<w:t>Some more list text</w:t>
</w:r>
</w
</ns0:Body>
I need to transform this XML into another XML Schema format which
requires paragraphs in the "Body" to be structured in this way
<Body>
<Section>
<Title>Subject Matter</Title>
<List>
<ListItem>Some list text</List>
</List>
<Para>Some text</Para>
</Section>
<Section>
<Title>Subject Matter 2</Title>
<Para>Some more text</Para>
<List>
<ListItem>Some more list text</List>
</List>
</Section>
</Body>
I have no control over the number of paragraphs that the Body will
contain and I think I need to use the w
which paragraphs need to become Section headings. As you can see all
the paragraphs after a BodyHeading paragraph need to be children of the
BodyHeading paragraph (which becomes a <Section>) until another
BodyHeading is found at which time the process starts again.
I am using XSL version 1.0 and am in big trouble.
Can anyone help.