[xsl] wordml to xml with pStyle as tags

Subject: [xsl] wordml to xml with pStyle as tags
From: Terry Ofner <tofner@xxxxxxxxxxx>
Date: Fri, 24 Mar 2006 13:51:10 -0500
Hi all,

Please forgive if someone has someone addressed this issue.

I have multiple wordml docs that I want to convert to more usable XML files for further processing. I would like to take the pStyle attribute; convert it into an element tag and surround the w:t text with the tags.

Here is an example of a wordml snippet:

<w:body>
<wx:sect>
<w:p>
<w:pPr>
<w:pStyle w:val="A-Head"/>
</w:pPr>
<w:r>
<w:t>Nouns</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pStyle w:val="Textwindent"/>
</w:pPr>
<w:r>
<w:t>A dictionary lists thousands of words. All these words can be divided into eight groups called the parts of speech. A word's part of speech is determined by the job it does in a sentence.</w:t>
</w:r>
</w:p>
. . .


I would like to get output something like this:

<A-Head>Nouns</A-Head>
<Textwindent>A dictionary lists thousands of words. All these words can be divided into eight groups called the parts of speech. A word's part of speech is determined by the job it does in a sentence.</Textwindent>


...

If this issue has been addressed in this list before, just point me in the right direction.

Best regards,

Terry

Current Thread