XML
  Home arrow XML arrow Back to XUL: Uniting XUL and RDF
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

Back to XUL: Uniting XUL and RDF
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-01-30

    Table of Contents:
  • Back to XUL: Uniting XUL and RDF
  • The Registration Process
  • Linking the DTD to the XUL File
  • Tell the Interface What to Do

  • 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


    Back to XUL: Uniting XUL and RDF


    (Page 1 of 4 )

    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.

    Now we have our main interface file, and I can imagine that you’re eager to see how it will look.  But before you can get even a glimpse of it (due to the use of entity references instead of text) there are several things you need to do.

    First, you need to describe the interface file in a language that Mozilla can understand; it needs to be described in the language of the Resource Description Framework (RDF.)  Its very name gives us an idea of the mechanism for how it works; the XUL file is a resource, and the RDF file describes it. 

    The idea behind this framework for description is to enable information that would normally be separate to have identifiable relationships defined about it. RDF enables you to write machine (and human) readable data about data – metadata in fact.

    The motivation behind this is of course, the semantic web.  This is a term that you may have heard, and is a vision of the W3C of an intelligent web where information is autonomously shared.  For a general example, image being able to search not for every web page that contains a target word or phrase, but for every page that contains a particular word in a particular context.

    Getting back to the subject from which we’ve strayed, let’s create the RDF file that Mozilla needs in order to understand our interface.  The implementation of RDF you are going to use is the RDF/XML strain. As such, your file will need to begin with the XML declaration:

    <?xml version="1.0"?>

    The RDF:RDF container is used as the top level container, and namespace attributes are used to define the child elements in use:

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

    Next, the RDF:Bag element describes the overall package:

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

    As you can see, the name of the resource is stated using the RDF list element (RDF:li.)

    Finally, additional information about the package is defined using the RDF:Description element:

    <RDF:Description about="urn:mozilla:package:interface"
              chrome:displayName="XUL Edit Lite"
              chrome:author="Dan Wellman"
              chrome:name="interface"
              chrome:version="1.0"/>

    The description element uses the same URN (Uniform Resource Name) that you specify in the RDF:Bag element to tie the information to the interface.  Finally, the RDF:RDF element is closed:

    </RDF:RDF>

    Save this file as contents.rdf in the content folder.

    More XML Articles
    More By Dan Wellman


       · Hello,Welcome to the third article in this series. This article foucses mainly...
     

    XML ARTICLES

    - 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
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek