ProjectPythonSourceForge
Welcome
Introduction
Suitability
Future Plans
Setup
Downloading XMLObject
Installing XMLObject
XMLObjApp
The XMLObjApp Application
Classes
Special Attributes
XML Attributes
Child Tags
File Menu
Saving and Loading
Sanity Test
Import XML...
Preferences...
File->Quit
Miscellaneous Operation Notes
Unicode and ASCII Strings
Manually Editing Your Parser
Outputting XML
XMLObject
XMLObject -- XML to Object Conversion
Stack -- Tracks the Document Hierarchy
All Docs on One Page

File Menu

Saving and Loading

Most of the items on the File Menu require very little explaination. File->Open (Ctrl-O), File->Save (Ctrl-S), File->Save As..., and File->Close all open, save, and close the current XML parser description as a Python module.

By default, XMLObjApp performs a sanity test before saving the parser file. If the test fails, XMLObjApp will alert you and ask if the file should be saved anyhow. Saving a parser with errors in it is risky as it may not be possible to load the parser later to fix the errors.

You may disable this pre-save test in the preferences.

Sanity Test

File->Sanity Test (Ctrl-T) runs a quick check on the parser you have created to make sure it makes sense. It checks for obvious problems, such as putting illegal characters in attribute names and defining a class multiple times, to more subtle mistakes, such as neglecting to define a class you use.

If successful, the Sanity Test will pop up a simple dialog to notify you of success:

Figure 3.9. Sanity Test Success

Sanity Test Success

On a failure, Sanity Test will open a list of errors and warnings:

Figure 3.10. Sanity Test Failure

Sanity Test Failure

The failure messages are pretty self-explanitory, so I won't waste time detailing each one. Error messages are marked with a symbol and warnings with a symbol. Click on any message link to jump to the appropriate class page and field that caused the problem. Errors certainly need to be fixed. Warnings may need to be fixed.

Import XML...

One of XMLObjApp's more convenient features is the File->Import XML... menu item. This function imports an XML file and takes some guesses about what sorts of classes, attributes, and children should go into your parser. The configuration will almost certainly not be correct, but it should save you tons of time in creating your parser. Simply import your XML file and then tweak all the settings until they match your file's structure.

Note

By default, File->Import XML... closes the current parser before importing the XML document. You may change this setting in the preferences.

Preferences...

File->Preferences... allows you to set all of the following:

Indention amount:

By default, XMLObjApp indents four spaces whenever creating a subordinate source code block. You may tweak this value here or instruct XMLObjApp to use a single tab character instead.

Changing this setting may have a profound effect on any code you have manually edited into your parser. I strongly recommend you pick a value and stick with it.

Column wrap:

By default, XMLObjApp wraps source code it generates at column 79. You may tweak this value here.

Recently used file list:

By default, XMLObjApp remembers the four most recently used parser files and keeps them on your File menu for easy access. You may tweak the number of files remembered here.

Import XML:

By default, XMLObjApp closes the current parser file before importing an XML document. You may also set the application to leave the current parser open (thereby adding new classes to it) or to ask if the current file should be closed before importing an XML document.

Special attributes:

This section of the preferences dialog allows you to set the default special attributes to use whenever a parser class is created.

Sanity test:

By default, XMLObjApp performs a sanity test before saving the parser file. If the test fails, XMLObjApp will alert you and ask if the file should be saved anyhow. Saving a parser with errors in it is risky as it may not be possible to load the parser later to fix the errors.

You may disable this pre-save test here.

Program paths:

XMLObjApp will guess appropriate values for the browser and help program paths. You may customize these values here.

File->Quit

File->Quit closes the XMLObjApp application.