XML to WordML basics

Posted by Level1Coder on Stack Overflow See other posts from Stack Overflow or by Level1Coder
Published on 2010-03-12T05:19:40Z Indexed on 2010/03/12 5:27 UTC
Read the original article Hit count: 479

Filed under:
|

I'm new to the world of XML. I'm not sure which way to build the XML so I provided 2 examples below.

My question is: Given the XML, how do I transform either Example#1 / #2 to the WordML Result? What technologies do I need to accomplish this?

Example#1:

<NumberedList1>
  <Paragraph>Paragraph one.</Paragraph>
</NumberedList1>

Example#2:

<NumberedList>1</NumberedList>
<Paragraph>Paragraph one.</Paragraph>

After transformation...

WordML Result:

<w:p>
  <w:pPr>
    <w:pStyle w:val="ListParagraph"/>
    <w:numPr>
      <w:ilvl w:val="0"/>
      <w:numId w:val="1"/>
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>Paragraph one.</w:t>
  </w:r>
</w:p>

If there is a way to transform the XML to WordML, maybe I can opt to save the data in XML format in the db instead of building both XML and WordML on the fly for 2 different formats.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about wordml