Any XML UI description has own set of tags and document structure. QXML is not an exception. It has a set of tags which represent qooxdoo classes, each tag has set of properties which are properties of the specific class. In addition, QxTransformer extends the syntax with custom tags and properties which add new functionality or provide shortcuts for common operations.
In order to validate XML UI file we use XML Schema which describes the structure of an XML document, allowed tags and attributes. There are 2 main advantages of using schema:
1) Structure validation
2) Autocompletion in almost all IDEs
Download the latest XSD
You can check out the newest XSD from your repository.
svn co https://qxtransformer.org/svn/qxtransformer/trunk/xsdGenerating XSD
QxTransformer provides automatic XSD generator for QXML dialect (since 0.4b). It uses excellent qooxdoo API documentation to get information on tags an attributes.
You can find XSD generator in
qxtransformer/bin/xsd-generator.py. Run
python xsd-generator.py --help to see all possible arguments for this script.
You will get following output:
Usage: xsd-generator.py [options]Options: -h, --help show this help message and exit -i INPUT_FILE, --input_file=INPUT_FILE File with qooxdoo XML API data. -o OUTPUT_FILE, --output_file=OUTPUT_FILE Destination XSD file.You should provide 2 options: XML file name with qooxdoo API data and XSD file name. You can get XML API data file for latest qooxdoo version (and others as well) in our SVN repository (https://qxtransformer.org/svn/qxtransformer/trunk/api/).
To generate XSD open terminal application and run following commands:
python qxtransformer/bin/xsd-generator.py -i path/to/xmlapi-version.xml -o path/to/qooxdoo-version.xsd
Using XSD for autocompletion
Many modern IDEs have code completion for XML. They use information from DTD or XSD to determine allowed tags and attributes and display them as a hint for users.
Eclipse
In order to add XSD locally to Eclipse, open Preferences -> XML -> XML Catalog and click 'Add' button.
Specify location to generated XSD file in your file system and click Ok.
Now you have auto completion for QXML.