Click here to Skip to main content
12,635,421 members (23,635 online)
Click here to Skip to main content
Add your own
alternative version

Stats

23.8K views
14 bookmarked
Posted

Learning WordML Basics

, 18 Jul 2006
Rate this:
Please Sign up or sign in to vote.
Introduction to WordML

Introduction

<FONT color=#000000>
<FONT color=#000000>Learning WORDML - Part 2
<FONT color=#000000> 
<FONT color=#000000>Now that we have come to know about WordML lets move a bit deep in understanding
<FONT color=#000000> 
<FONT color=#000000>Why WordML?
<FONT color=#000000> 
<FONT color=#000000>Obviously this must be the question while using any newer technology every time. Make repeated query and study why this newer technology is introduced, what made them to device a higher version and other stuffs. This exercise would give a deeper insight of the current technology and a way to understand the disadvantages and discomforts in the earlier ones. Again back to square one. Why WordML? Earlier versions on Word doesn't provide any option to save the Word in XML.Reading any particular data from a Word Document was a difficult task.It was converted to HTML, then after some operations it was converted to XML and then it was analyzed. Now with the facility of WordML analysis of Word Documents has become much much simpler.
<FONT color=#000000> 
<FONT color=#000000>Once the XML is in hand, we can really play around with XML and manipulate on the contents very easily.
<FONT color=#000000> 
<FONT color=#000000>What is WordML made of?
<FONT color=#000000> 
<FONT color=#000000>In the previous write-up there was a simple example of WordML, lets recollect it again
<FONT color=#000000>_______________________________________________________________________
<FONT color=#000000><?xml version="1.0"?>
<w:wordDocument
   xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml">
 
<FONT color=#000000><w:body>
      <w:p>
         <w:r>
            <w:t>Have a Great Day Ahead</w:t>
      </w:r>
   </w:p>
</w:body>
 
<FONT color=#000000></w:wordDocument>
<FONT color=#000000>_______________________________________________________________________
<FONT color=#000000> 
<FONT color=#000000>The document is collection of Paragraphs (w:p)
<FONT color=#000000>The Paragraph is made up of Text Runs (w:r)
<FONT color=#000000>The Text Runs are made up of Text Pieces (w:t)
<FONT color=#000000> 
<FONT color=#000000>The xml document is ready. Save the above lines in SampleWordml.xml and save it. When you double click on the icon the file is opened in IE (by default). But suppose we wanted to view the same in Word while double clicking add a line of code
<FONT color=#000000> 
<FONT color=#000000><?xml version="1.0"?>
<FONT color=#000000><FONT color=#006666><?mso-application progid="Word.Document"?>
<w:wordDocument
   xmlns:w="
http://schemas.microsoft.com/office/word/2003/wordml">
<FONT color=#000000> 
<FONT color=#000000>Once this change is made and saved, the icon itself changes and clicking on the icon directly opens in a Word.
<FONT color=#000000> 
<FONT color=#000000>What if not a perfect WordML?
<FONT color=#000000> 
<FONT color=#000000>Suppose there is some typo error or missed closing a tag in the WordML what happens when we try to open the same file in Word? Word doesn't automatically close the tag instead it gives an error on opening the doc. The line number and type of error can also be obtained
<FONT color=#000000> 
<FONT color=#000000>
 
<FONT color=#000000>
<FONT color=#000000> 
Sample image
<FONT color=#000000>A small error was made in <w:t> Tag. The Word dint open the same document and gave an error.
<FONT color=#000000> 
More in the next ...

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 18 Jul 2006
Article Copyright 2006 by Umanath Selvan
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid