Opening Thdl Essay In Xml Editor

THL Toolbox > Essays > Creating an XML Essay for THDL > Opening Essay in XML Editor

Opening THL Essay in XML Editor

Contributor(s): THL Staff.

When the conversion macro finishes running, one will see XML in the document window and a message pane will pop-up saying:

Conversion complete!

If you save the Word document at this point, give it a new name by using “Save As” (F12). You can now open up the resultant XML file in your XML editor. Test the document to see if it is valid XML, according to the editor’s instructions. Correct any invalid markup that may occur. Below are listed the basic principles of XML, which will help in troubleshooting the invalidities:

  • Every opening tag must have a close tag.
  • Elements cannot overlap but must be nested. If one element opens within another element, it must close before that other element closes. The following is not permissible: <title>The Compendium of <hi>Principles</title></hi>. This is particularly important with <div>s. In such cases, the line number given by the error message will not necessarily correspond with the line number of the mistake because it will give the opening line number for the <div> but the mistake may be at the end of the <div>.
  • All attribute values must be included within double quotes, e.g. <hi rend="weak"> is o.k. but both <hi rend=weak> <hi rend=“weak”> (with smart-quotes) are wrong.

Also, the line number given in the error message may not exactly correspond to the place of the error. For one, a long line of text will wrap and cover several lines on the editor's text screen. The Morphon XML editor will repeat the line number before each of these wrapped lines.

Note: This feature can be turned off by going to Edit menu, Preferences, Source view, and clicking on the “Show line number only once” option.

Secondly, if the error has to do with the closing of a large section, such as a <div1>, <div2>, or <div3>, then the error line number may be the beginning of that section but the error itself might be at the end with a missing closing tag or vice versa. With such errors, one has to go to a place before the error and count the divs, making sure that the proper levels are opened and closed in a valid way. Thirdly, if a child element of the div is not closed or there is an extra closing tag in the div, then the line number of the error will be the closing tag of the div and not where the actual error is. To find such a mistake, one has to check all children elements of the div individually to make sure all opening tags have a corresponding close tag and vice versa.

Finally, one may wish to add further mark-up to the document that is not automatically added by the converter. A mention has already been made about lettered lists. All lists with the style “List Number,ln” are turned into numbered lists with Arabic numerals. These are marked with the tag <list rend=“1”></list>. To create a list “numbered” with letters, Roman numerals either upper or lower case, change the rend attribute to the first one of those numbers, e.g. “i”, “I”, “a”, “A”. The documentation for this and other fineries of THL markup can be found in the XML Markup Manual for THL.

A more detailed discussion of XML Editors.

Note: One important glitch in Morphon that is important to note is that sometimes when entering text into a tag the text will stop displaying after a linewrap. If you are typing and nothing seems to be happening, this has something to do with the WYSIWYG display. It can be fixed by going into the Tools menu. Choosing Edit CSS, and clicking on the blue, graphic of the letter A in the button bar. This reapplies the styles and will cause the missing text to appear.

Provided for unrestricted use by the external link: Tibetan and Himalayan Library