1 | 2

6 - 10   [10]

Welcome Back Breeze!

Relates to Firefox and Co

Nice to finally have the Breeze theme back on my Firefox.

Posted on Mar 07, 2004 at 20:47:15. [Comments for Welcome Back Breeze!- 0]

XUL Preview In UltraEdit

Relates to Firefox and Co and XUL, IDEs

While the XUL Console discussed in the previous post is a useful tool for learning the XUL language by example with instant testing, it embeds the <window> within the XUL Console itself, so GUI display is not accurate. This can probably be overriden with JavaScript, but since I am still in the early days of XUL discovery focusing on the markup and CSS I decided to set up a Tool Configuration in UltraEdit instead, to allow XUL applications to be run straight out of the editor. First the XUL package needs to be registered in installed-chrome.txt under the Mozilla root:


content,install,url,resource:/chrome/my_xul_file/content/
locale,install,url,resource:/chrome/my_xul_file/locale/en-US/
skin,install,url,resource:/chrome/my_xul_file/skin/

For some inexplicable reason I also found I had to manually enter the skin framework into the application chrome.rdf file:


<RDF:Seq about="urn:mozilla:skin:modern/1.0:packages">
  
  [..]
  
  <RDF:li 
    resource="urn:mozilla:skin:modern/1.0:my_xul_file"/>
</RDF:Seq>

[..]

<RDF:Description about="urn:mozilla:skin:modern/1.0:findfile"
               c:baseURL="resource:/chrome/my_xul_file/skin/">
  <c:package resource="urn:mozilla:package:my_xul_file"/>
</RDF:Description>

The installed-chrome.txt file should have done this for me. Anyway, with the package registered, an UltraEdit Tool Configuration can be configured with the following command line:


"C:\Program Files\mozilla.org\Mozilla\mozilla.exe" _
  -nosplash -chrome "chrome://%n/content/%n%e"

Where _ is a line continuation. By adding the tool to the menubar, my XUL previews are just one click away. Note that if another instance of Mozilla is running at the same time, the preview will not update since it will use the chrome files from the instance that is already running. So I view the XUL Tutorial and Programmer's Reference in Firefox while I work on my XUL.
[ Micro who?! ;) ]

Posted on Mar 07, 2004 at 20:46:32. [Comments for XUL Preview In UltraEdit- 1]

Venkman Debugger To The Rescue

Relates to DOM Scripting and Firefox and Co, XUL

I have had some problems getting the XUL Console to work on Mozilla 1.6. I caught a brief glimpse of the sample widgets the first time I ran it, but since then the console has been blank and totally functionless. Since I was keen to utilise the downloaded version of Alice Corbin's Periodic Table to help learn the markup, and with lack of bug reports for the console on MozDev, I decided to try and debug it myself.

The JavaScript Console told me the error was an unrecognised path in the file chrome://mozlib/content/lib/js/io/file/instantiator.js, part of the MozLib extension library. So, enter the Venkman JavaScript Debugger. This was the first time I had test run this for genuine reasons, but it is relatively easy and intuitive to get going.

  1. Open up the Debugger.
  2. Uncheck the Exclude Browser Files option in the Debug menu since the target was part of the chrome.
  3. Start up the XUL Console.
  4. Locate the file instantiator.js in the Loaded Scripts window and set a break point on the line the error was occurring (Line 73).
  5. Attempt to perform a function in the XUL Console.
  6. The Debugger stops on the breakpoint, and the variable at fault can be examined.

The error was clear, the directory path to Mozilla was set in Windows format with escaped backslashes, while the additional path to the particular file (in this case the samples) was set with forward slashes. (One of the many Windows banes!). Well, time was not available to delve deep into the MozLib library and find out where this was originating, so I settled with adding a regular expression snippet at this point to correct the path and see if that would work.


var re = /\//g;
var result = path.replace(re, "\\");
path = result;

The problem was resolved and now the XUL Console is functioning perfectly. I could have quite easily passed an hour reinstalling the extensions and editing chrome files in an attempt to fix this, but in 5 minutes Venkman had pointed me in the right direction and the problem was resolved - an excellent tool!

Posted on Mar 07, 2004 at 20:45:12. [Comments for Venkman Debugger To The Rescue- 1]

Oscar Whitewash

Relates to Movies

What a night to finally see Peter Jackson's epic get the glory it deserves taking a 100% clean sweep of eleven Oscars against such an excellent collection of nominations. Return of the King was a truly fantastic realisation of Tolkien's great fantasy and an emotional rollercoaster to seal the trilogy. I was particularly pleased to see Annie Lennox rewarded, and Howard Shore for his mesmerising score. But, with the incredible technology explosion in film making, how long is it going to be before the Oscar for best animated character arrives on the scene - Smeagol should have led the way!

Posted on Mar 01, 2004 at 05:18:24. [Comments for Oscar Whitewash- 0]

XML Resume Test Drive

Relates to Web Standards and Java, XML Schema

The Sourceforge project XML Resume is an excellent tool for compiling a resume quickly in different formats (although I find the current document type definition slightly limited). It is well packaged and quick, and easy, to configure and run the examples with the Make utility, also offering some convenient filtering features. Unfortunately however, my personal resume was reluctant to build, with Xalan returning an ArrayIndexOutOfBounds exception.

Once I broke the XML instance apart, the error was soon tracked down. Using XML Spy to create the instance, I had inadvertantly left empty values in a couple of the level attributes for skill content. Since the attribute-list declaration in the DTD is

<!ATTLIST skill level CDATA #IMPLIED>

the instance still validated, so I missed the error.

One resolution is to wrap the contents of the XSLT template for skill/@level within another conditional statement that tests the length of the attribute value.


<xsl:template match="skill/@level">
  <strong><xsl:if test="string-length() > 0"></strong>
    […]
  <strong></xsl:if></strong>
</xsl:template>

However, this burden shouldn't fall to the transformation file, since it is the role of the Schema/DTD to define the contract for the instance. DTD syntax has no means to prevent this error, while in XML Schema it is simply a matter of defining a custom simple type.


<xsd:simpleType name="nonZeroString">
	<xsd:restriction base="xsd:string">
		<xsd:pattern value="\w.*"/>
	</xsd:restriction>
</xsd:simpleType>

In this example the pattern facet requires the attribute value to be at least one word character. The facet <xsd:minLength value="1"/> serves the same purpose sans regular expressions. An XML Schema shell has recently been posted in the project's forum.

Posted on Mar 01, 2004 at 05:15:57. [Comments for XML Resume Test Drive- 0]

Breadcrumbs Trail

[ Home ] -> TW Blog -> Archives for March 2004
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.016 seconds