XML
  Home arrow XML arrow Page 2 - 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 
Sun Developer Network 
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 - The Registration Process


    (Page 2 of 4 )

    Now for the registration process. If you had used plain text labels throughout your file, you would be able to open this file in Mozilla in a kind of low privilege, view only mode.  It would be opened using the standard File à Open method, but as a chrome URL has not been used, it would not have file system access or anything like that. 

    To register your file with Mozilla then, you need to browse to the Mozilla chrome directory (C:\Program Files\mozilla.org\Mozilla\chrome) and find a file called installed-chrome.txt.  Even though this is a simple text file, it will look a little odd when viewed in Notepad, so I would recommend using something a little more powerful (I use a fantastic freeware application called nPad2). 

    So open the file and you will see basically a list of all of the chrome that makes up the Mozilla interface.  Go to the end of the file and add the following instruction:

    content,install,url,file:///C|/XUL/XULEditLite/Content/

    If you have saved the interface file in another location, adjust the above line of code accordingly.  Also, make sure that you hit the return key after entering the final forward-slash.

    Also in the chrome folder is a file called chrome.rdf which you need to delete.  Now open Mozilla, and this file will reappear in the chrome directory.  Provided you entered the above instruction correctly, you should be able to find a section in the chrome.rdf file describing the Interface file we have created.  This will denote successful registration of the interface file. 

     

    There still remains something that needs to be done, however, before we can finally view our interface.  We need to make, and register, the DTD file.

    Open a new file in your text editor and begin once more with the XML declaration:

    <?xml version="1.0"?>

    Now for each of the entity references from the interface file, you need to add an entity declaration:

    <!ENTITY fileLabel "File">

    This is an easy file to code. As the example shows, you declare each entity using the !ENTITY keyword followed by the entity reference name, followed by the string you want displayed double-quoted.  Easy.  Now for the rest of the file:

    <!ENTITY openLabel "Open">
    <!ENTITY closeLabel "Close">
    <!ENTITY saveLabel "Save">
    <!ENTITY newLabel "New">
    <!ENTITY xulLabel "XUL File">
    <!ENTITY htmLabel "HTML File">
    <!ENTITY xmlLabel "XML File">
    <!ENTITY exitLabel "Exit">
    <!ENTITY editLabel "Edit">
    <!ENTITY copyLabel "Copy">
    <!ENTITY pasteLabel "Paste">
    <!ENTITY cutLabel "Cut">
    <!ENTITY helpLabel "Help">
    <!ENTITY helpContentsLabel "Help Contents">
    <!ENTITY aboutLabel "About">
    <!ENTITY toolbarsTooltip "Insert Bar Element">
    <!ENTITY menubaLabel "Insert menubar">
    <!ENTITY toolbarLabel "Insert toolbar">
    <!ENTITY toolbarButtonLabel "Insert toolbar button">
    <!ENTITY menuseparatorLabel "Insert menu seperator">
    <!ENTITY formsTooltip "Insert Form Element">
    <!ENTITY textboxLabel "Insert textbox">
    <!ENTITY listboxLabel "Insert list box">
    <!ENTITY radioLabel "Insert radio button">
    <!ENTITY windowsTooltip "Insert Window Element">
    <!ENTITY windowLabel "Insert window">
    <!ENTITY wizardLabel "Insert wizard">
    <!ENTITY editorLabel "Insert editor">
    <!ENTITY browserLabel "Insert browser">
    <!ENTITY iframeLabel "Insert iframe">
    <!ENTITY titlebarLabel "Insert titlebar">

    This file should be saved with a .dtd extension in the en-US folder.  The file name should match the filename of the main XUL file, in this case, interface.dtd.  There will be more text strings to add to this file at some point in the future, as we will need to add the text this is displayed in the help pop-up, but we can add that later, once we have coded the additional window itself.

    Now, the final step before we are able to take a look at the fruits of our labor is to register the DTD and link it to the XUL file.

    More XML Articles
    More By Dan Wellman


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

    XML ARTICLES

    - 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
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT