Home arrow XML arrow Page 4 - Back to XUL: Introduction and Preparation
XML

Back to XUL: Introduction and Preparation


XUL is an XML variant that can be used to create application user interfaces. It can also be used as an element in creating entire applications. This article, the first in a series, introduces you to the idea and helps you get your system ready to start creating.

Author Info:
By: Dan Wellman
Rating: 5 stars5 stars5 stars5 stars5 stars / 5
January 16, 2006
TABLE OF CONTENTS:
  1. · Back to XUL: Introduction and Preparation
  2. · Creating applications with XUL
  3. · Setting up your system for running XUL applications
  4. · More setup information

print this article
SEARCH DEVARTICLES

Back to XUL: Introduction and Preparation - More setup information
(Page 4 of 4 )

The directory structure used here represents a simplified version of that used by Mozilla, although Mozilla also makes use of packaged Java Archive files (.JAR).  Creating the application in this way makes testing it a little trickier; you need to create the interface file first so that you know which entities you need to put in your DTD, however, you need to register the DTD in the chrome registry before your interface file can read the entities in it, and hence before it will work. 

You will also need to describe the application using a contents.rdf file, another file that helps build the chrome registry that ensures Mozilla has all of the information required to run your application.  Once we have created the interface and contents files, you will see information taken from the contents.rdf file and added to the chrome.rdf file, information such as the name of the application, the name of the developer and the version number.

The chrome registry acts like a list that specifies the locations of the files used in your application.  DTDs, stylesheets and other files are accessed using a chrome URL which points the application to the files it needs.  The URLs can be hard-coded into files, such as the chrome.rdf file, or entered into a command line prompt or the browser's address bar to launch the requested file.  Generally, the latter format is used to open your application, while the hard-coding method is used by the application to locate the associated files (such as stylesheets and DTDs.)

The registry itself is just a simple text file (called chrome.rdf) that contains a list of the physical paths of every aspect of chrome in use.  It also contains information about the different components.  This file is regenerated each time the application is run, and you will know whether you have successfully added your files when you see a section regarding your application appear in this file.  It takes information for the registered components from another simple text file (called installed-chrome.txt) that can be edited to ensure components you add are registered and available to the application.

For the sake of the flow of the article series, we will create our interface file first, and the associated, required files afterwards.  This will mean that you wonít be able to test the interface right away, but donít worry, once everything is in place and registered you can test the application and correct the inevitable errors.  Usually, these will be typos or other such simple mistakes. 

I hope this has been an easy introduction for those that have not been exposed to XUL or a useful refresher for those that have.  Article two will walk you through creating the interface file.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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