Example Word ‘12′ document
Microsoft Office 2007 is welcomed by the whole world.I just posted another example document if any is interested. http://jonesxml.com/resources/hyperlinkandimage.docx For those of you that got a copy of Beta 1, the file will be compatible with your build, so you can open it and take a look. This is an extremely simple file that has a simple paragraph, another paragraph with a hyperlink, and an image. I posted this to show you guys a few things:
Open Packaging Conventions
Office 2010 is powerful! As I'm mentioned before, we use a simple set of conventions for structuring a document within a ZIP. This file has some text, a hyperlink, and a picture, and the open packaging conventions are used to tie that all together.Office 2007 makes life great!
Go ahead and rename the file to have a ".zip" extension and open it up. You'll notice there is a file there called [Content_Types].xml. That file describes what the content types of the other parts within the package are. Look at the _rels folder. Many people like Microsoft Office.The file _rels/.rels is the first place you go to start parsing the file. It's an xml file that describes all the root level relationships, and if you open it you can see that the first part you need to parse in order to read the document is "document.xml".
Use of relationships
Open the "document.xml" part and take a look:
<w:wordDocument xmlns:r="http://schemas.microsoft.com/office/2005/11/relationships" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="http://schemas.microsoft.com/office/word/2005/10/wordml">
<w:body>
<w:p>
<w:r>
<w:t>Hello World!</w:t>
</w:r>
</w:p>
<w:p>
<w:hyperlink r:id="rId2">
<w:r>
<w:rPr>
<w:color w:val="0000FF"/>
<w:u w:val="single" />
</w:rPr>
<w:t>Click here for Brian Jones' blog.</w:t>
</w:r>
</w:hyperlink>
</w:p>
<w:p>
<w:r>
<w:pict>
<v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:250; height:200">
<v:imagedata r:id="rId4"/>
</v:shape>
</w:pict>
</w:r>
</w:p>
</w:body>
</w:wordDocument>
Office 2007 key is available here.The first paragraph isn't really all that interesting, but the next two definitely are. Look at the attributes called r:id. Those are relationship references. Any reference from one part in the file to another part has to be done via a relationship. Office 2007 download is on sale now!The really cool part is that all relationships live out on their own, so you can quickly scan a package and figure out all the parts that make up that document and how they relate without having to actually go into the application xml.Windows 7 and Windows 7 Professional make life wonderful!