Monday, 14 March 2011

Write XML in Microsoft Word?

Yes that’s right, you can use Microsoft Word 2003 and newer versions to write XML so you don’t need to bother with those complicated XML editors. Writing XML on Microsoft Word is still a new feature and as a result of this, it is not perfect but it is a start in the right direction and issufficient for basic usage. In short, if you are a serious XML programmer then go and get yourself a proper XML editor but if you are looking to write XML as a one off thing then this additional feature would come in handy. So how do you write XML on Microsoft Word? Well, take a look at my top tips to get you started.

Setting up an XML file
No doubt anyone who has used Microsoft Word will be familiar with opening and saving a standard Doc or DOCX file. Opening and saving an XML file is not much different, you simply need to remember to tell Microsoft Word that you are writing an XML file. Follow the simple steps below:
  • Click the File tab
  • Select Save as
  • From the Window that appears select Word XML Document
  • Give your XML a meaningful name and then press SAVE 
XML files are opened in the same way as how normal files are opened however, if you have many files in one folder, it can be a nuisance to browse through all your files to find your XML file. Here is a useful tip, when opening a file, select XML Files from the File type drop down list. This will filter all your files and only show files saved as XML.

Open XML
Files saved in Word as XML are part of the new Open XML 2.0 format which Microsoft introduced recently. This has a number of benefits such as improving security and using zip compression technology to make file sizes up to 75% smaller but the key benefit as far as XML is concerned is that it increases interoperability by allowing Word documents to be saved as XML which can then be freely viewed by anyone. Office 2010 comes with the new Open XML 2.0 SDK preloaded however, those using the older versions may have the older Open XML SDK 1.0 and would need to download the latest version of Open XML from the Microsoft website. 

No comments:

Post a Comment