THL Toolbox > Essays > Creating an XML Essay for THL > Converting a THL Essay to XML
Contributor(s): Than Grove.
Once the appropriate Word styles have been applied to the document and the metadata table has been added and filled out, one is ready to begin the conversion process. The conversion process uses Visual Basic for Applications (VBA) macros to convert the document to XML. For these to work, some preliminary set up is required.
The conversion process uses VBA macros that read a data file external to the document. Therefore, the following steps must be done for the conversion to work:
- First, one must have macros turned on for that document. Check this by going to the Tools menu, choosing Macron, and then Security. The security level should be set to “Medium”. This will prompt the user every time they open the document asking whether or not one wishes to enable macros. The “Low” setting will allow one to open the document without prompting, but this is not recommended for security reasons.
- Second, the data file (teiHeader.dat) must be put in the right place (C:
xml) . If the C:
xml folder does not exist, create it at the root level of your “C“ hard drive. Place the file in the .zip archive, teiHeader.dat, in that folder.
- The metadata table must be present in the document to be converted. This is a table found in the WordToXMLConverter.doc but is also included within the .zip archive. It must be at the top of the document to be converted. See above for instructions on how to fill the table out.
The keystroke Alt+Ctrl+Shift+C will initiate and run the conversion macro. The macro will initially ask the name of the output file and display the name of the folder where it will be created. If the folder named is not the one desired, cancel the process and “Save As“ the document to be converted into the desired folder. Once converting, one can watch the conversion process in the document window and a progress bar will be displayed to determine the conversion progress. Should the converter lock up or otherwise fail before conversion is complete, one must try converting it again (Note: If the converter truly locks up, one may have to force quit and retrieve the document by reopening Word). In such cases, try breaking the document into parts, creating separate documents for each section. Make sure all the headers remain at the same level and put in dummy headers to get to that level if necessary. They try converting the smaller documents individual. If this still does not work, contact the THL. Should the conversion work a message indicating it is complete will pop-up on your screen, indicating you now have an XML document.
Important: When the document is finished converting, it is best to Save As under another name so that one will not loose the work done at applying styles and so forth to the original word document.