Home arrow XML arrow Page 3 - Back to XUL: Uniting XUL and RDF
XML

Back to XUL: Uniting XUL and RDF


In the previous article in this series, we put together the main interface file. Before you can see how it will look, however, you need to describe it in a language that Mozilla can understand. This article will show you how to create the appropriate RDF file, register it with Mozilla's chrome directory, and in general get to the point where you can see the fruits of your labors over the previous two articles.

Author Info:
By: Dan Wellman
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
January 30, 2006
TABLE OF CONTENTS:
  1. · Back to XUL: Uniting XUL and RDF
  2. · The Registration Process
  3. · Linking the DTD to the XUL File
  4. · Tell the Interface What to Do

print this article
SEARCH DEVARTICLES

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.


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials