99

I want to see my .docx in its pure XML format.

Various application like internet browsers and visual studio will open the file up in Word for me.

I've also tried renaming the document to .xml extension and it just opens up in notepad showing a bunch of unintelligible text.

RoboShop
  • 3,696

4 Answers4

148

It's a zipped file. Rename it ending in .zip to view it.

Hello71
  • 8,673
  • 5
  • 42
  • 45
31

Working on macOS, and don't want to install any software to see the XML from your .docx documents? Just open up the terminal and:

cd path/to/your/file.docx
unzip file.docx -d file-content

As mentioned above, .docx files are "disguised" zip files, and unzip is installed by default on macOS. After using it, your file-content folder will contain the various .xml files composing the Word document.

Clorichel
  • 411
2

Just learned today that you can get at the raw XML from foo.docx from the cygwin ( linux-like ) commandline

unzip  -q -c 'foo.docx' word/document.xml
1

I unpacked the zip file en edited the document.xml using Notepad++ (Plugins/XML tools/Check XML syntax now). Notepad++ noticed me at swapped elements, I placed the elements in a more logical order and repeated the steps until no more issues were found. Then I copied all the files directly into zip using Total Commander and finally renamed it back to *.docx. Word happily opened the file.

What I am saying is that if Word still refuses to open the file then there may be some more issues in one or more of xml files. Tip: use IE to quickly check an XML-file. If you see only flat text or even nothing at all, you can bet there is something wrong with the xml.

Victor
  • 21