Back to XUL: Uniting XUL and RDF - Linking the DTD to the XUL File
(Page 3 of 4 )
As the DTD file is technically a resource, we are going to describe it with another contents.rdf file. In a new text file, begin in the normal way with the XML declaration and the opening RDF:RDF statement, complete with namespaces:
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
Next, we give a name for the resource using the same bag and list format:
<RDF:Bag about="urn:mozilla:locale:root">
<RDF:li RDF:resource="urn:mozilla:locale:en-US"/>
</RDF:Bag>
We then use an RDF:Description to provide further details of the resource:
<RDF:Description about="urn:mozilla:locale:en-US">
<chrome:packages>
<RDF:Bag about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:interface"/>
</RDF:Bag>
</chrome:packages>
</RDF:Description>
Finally, the RDF:RDF element can be closed:
</RDF:RDF>
This file should be saved in the same location as the locale file it is describing. We can now register this, much in the same way as the main interface file was registered. Again, find the installed-chrome.txt file and add the following line to the bottom of the file:
locale,install,url,file:///C|/XUL/XULEditLite/locale/en-US/
Press return at the end, save and close the file, and as you are in the Mozilla/chrome directory, delete chrome.rdf. Again, if this is done correctly, information relating to this locale will appear in the chrome.rdf file once it is recreated by Mozilla.

Next: Tell the Interface What to Do >>
More XML Articles
More By Dan Wellman