xsl-list
[Top] [All Lists]

[xsl] wordml to xml with pStyle as tags

2006-03-24 11:51:34
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--