Overview
The schema consists of a few actual XSD files and is generated from a few different sources. This makes the generation a bit confusing.
Using an already generated schema should be easy: just keep the three XSD files together and use xul.xsd for validation and other needs.
The two main sources are:
- refall_elemref.xml—Neil Deakin's XUL Elements Reference in XML format. The list of elements and supported attributes and descriptions is generated from it.
- xulstructure.xml (included in the package)—Structural information based on work by Franklin de Graaf on XULMaker's schema.
The resulting schema is split across a few different files:
- xul.xsd—The main file you should specify whenever you need the schema. It is the only resulting file that's not generated, and it contains license and basic usage information. At this moment it just includes other, generated, files, but it can also be used to provide additional schema definitions, if needed.
- xulplanet.xsd—Provides definitions and descriptions for XUL elements, attributes, values and types. Generated from the XUL Reference.
- xulstructure.xsd—Provides information on element types, and what valid content for a given element is. Generated from xulstructure.xml.
Step-by-step guide
- Get the XUL Elements Reference in XML format (refall_elemref.xml)
- Remove redundant data from it by processing the file with strip_elemref.xsl stylesheet. Name the resulting file xulplanet.xml.
- Run the xulplanet2schema.xsl stylesheet on xulplanet.xml, save result as xulplanet.xsd.
- Run the xulstructure.xsl stylesheet on the xulstructute.xml file to get xulstructure.xsd.
- Put xulplanet.xsd, xulstructure.xsd and xul.xsd files in the same directory. Use xul.xsd.
Why is it so confusing
- One of the reasons behind this is to allow the schema be regenerated if an updated version of the XUL reference is available.
- Another is that the XSD syntax is quite verbose and hard to read and to edit. With this scheme we edit the source XML files with quite simple syntax.