I need to convert a Word document into an easily parseable format, so I chose XML. I found a tool which works, but it doesn't tell me which font the text is, which is my main method of parsing. Is there any tool that preserves this information or a link to a tutorial that provides code?
2 Answers
Word 2012 (and Word 2007 via add-in) can store Word documents in WordML (.docx) with is an xml format.
This format is easily parsable - there are libraries for several languages, and some, like .NET have built-in parsing capabilities.
You need an accompanying XSL document, this should help: http://webdesign.about.com/cs/xslinformation/a/aa051198.htm
-
-
Have you tried the online example at W3C, they have a demo you can try out? I've never had to style XML so dont have a personal example I can show you but looking at this demo it looks pretty straight forward. w3schools.com/xsl Feb 27, 2012 at 22:07
-
Not sure what context is your doing this but if it is web development its much easier to style the outputted XML via CSS Feb 27, 2012 at 22:21