XML
  Home arrow XML arrow Page 2 - An Introduction to XUL Part 4
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

An Introduction to XUL Part 4
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2005-06-13

    Table of Contents:
  • An Introduction to XUL Part 4
  • Using the RDF/XML Syntax
  • Creating the Wizard
  • Adding to the installed-chrome.txt file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Virtual Tradeshows by Ziff Davis Enterprise – A Unique Opportunity to Interact with IT Experts, Access Information, and Gain Insight on Today’s Trends in Technology Learn more

    An Introduction to XUL Part 4 - Using the RDF/XML Syntax
    (Page 2 of 4 )

     

    To store RDF in a file that applications are able to use, you need to use the RDF/XML syntax. There are other implementations, such as N3, but RDF/XML works very well with Mozilla and may appeal to those of you that have some XML experience. As we’ve been discussing RDF already, we will begin by creating the RDF/XML file, although in reality, it would probably be the XUL file that you would create first. Nevertheless, in a text editor, begin again with the XML declaration:

    <?xml version="1.0"?>

    This is not strictly necessary, but should be included for well-formedness. Next, you need to add the RDF container with some namespace properties and the RDF and chrome namespaces:

    <RDF:RDF xmlns:RDF="http://www.w3.org/1999/
             02/22-rdf-syntax-ns#"
             xmlns:chrome="http://www.mozilla.org/rdf/chrome#">

    Next you need to tell Mozilla that you’re describing a list of your applications:

    <RDF:Bag about="urn:mozilla:package:root">

    I have placed this in a bag container, which is standard RDF syntax for an unordered list. If I wanted to create an ordered list, it would be an <RDF:Seq> sequence.  Your application is then defined as an item of the list:

    <RDF:li resource="urn:mozilla:package:mywizard"/>
    </RDF:Bag>

    You now need to provide a description of your application:

    <RDF:Description about="urn:mozilla:package:mywizard"
              chrome:displayName="Wizard"
              chrome:author="Dan Wellman"
              chrome:name="mywizard"
              chrome:version="1.0"/>

    Once this has been added, you need to close off the RDF container:

    </RDF:RDF>

    And save the file as contents.rdf in the same folder that your wizard application will reside in. This can be any folder, but I would recommend creating a chrome folder in your XUL folder and saving both the RDF and the wizard files in that. 

    You might be wondering how you could use this file to describe two XUL files. No? Well I’ll tell you how anyway, because sooner or later, you will want to know.  It’s simple; all you do is add a second block of code similar to the first, but with the filename of your second XUL file. Then whole file would look like this:

    <?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#">

    <RDF:Bag about="urn:mozilla:package:root">
      <RDF:li RDF:resource="urn:mozilla:package:fredswizard"/>
    </RDF:Bag>

    <RDF:Description about="urn:mozilla:package:fredswizard"
              chrome:displayName="Freds Wizard"
              chrome:author="Fred"
              chrome:name="fredswizard"
              chrome:extension="false"/>

    <RDF:Bag about="urn:mozilla:package:root">
      <RDF:li RDF:resource="urn:mozilla:package:danswizard"/>
    </RDF:Bag>

    <RDF:Description about="urn:mozilla:package:danswizard"
              chrome:displayName="Dans Wizard"
              chrome:author="Dan"
              chrome:name="Danswizard"
              chrome:extension="false"/>
    </RDF:RDF>

    It’s not elegant, and you would think that being a list you could just add the second RDF:Resource statement to the first bag, but doing this will simply not work.

    More XML Articles
    More By Dan Wellman


       · I have a question about wizard.Everything works fine if you just move through the...
       · Hi,I'm not sure that the wizard has this functionality, maybe using a set of...
     

       

    XML ARTICLES

    - How to Set Up Podcasting and Vodcasting
    - Creating an RSS Reader Application
    - Building an RSS File
    - An Introduction to XUL Part 6
    - An Introduction to XUL Part 5
    - An Introduction to XUL Part 4
    - An Introduction to XUL Part 3
    - An Introduction to XUL Part 2
    - An Introduction to XUL Part 1
    - XML Matters: Practical XML Data Design and M...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway