Take the 2-minute tour ×

I have an XULRunner app. It is mostly working however I have a problem. There are some reports in the app implemented as HTML forms. One of the options for the user is to output into CSV format. In Firefox, the user is asked to save the file or open it (in Excel or whatever). In the XULRunner app I get a popup containing:

XML Parsing Error: undefined entity
Line Number 30, Column 18: &intro.label;

This seems to be related to branding as discussed here:

I think I have followed the instructions. They are a little vague in places. Here is what I have:

chrome/chrome.manifest contains:

locale branding en-US chrome/locale/branding/
content branding chrome/branding/

chrome/branding/ contains these files: about.png, icon48.png, icon64.png

chrome/locale/branding/brand.dtd contains:

<!ENTITY  brandShortName        "ArcaMax EC">
<!ENTITY  brandFullName         "ArcaMax EC">
<!ENTITY  vendorShortName       "ArcaMax">
<!ENTITY  trademarkInfo.part1   " ">

chrome/locale/branding/brand.properties contains:

brandFullName=ArcaMax EC4

homePageSingleStartMain=Firefox Start, a fast home page with built-in search
homePageImport=Import your home page from %S

homePageMigrationPageTitle=Home Page Selection
homePageMigrationDescription=Please select the home page you wish to use:


chrome/locale/branding/unknownContentType.dtd contains:

<!ENTITY  intro.label                 "You have chosen to open">
<!ENTITY  from.label                  "from:">
<!ENTITY  actionQuestion.label        "What should &brandShortName; do with this file?">

<!ENTITY  openWith.label              "Open with">
<!ENTITY  openWith.accesskey          "o">
<!ENTITY  other.label                 "Other…">

<!ENTITY  saveFile.label              "Save File">
<!ENTITY  saveFile.accesskey          "s">

<!ENTITY  rememberChoice.label        "Do this automatically for files like this from now on.">
<!ENTITY  rememberChoice.accesskey    "a">

<!ENTITY  whichIsA.label              "which is a:">

<!ENTITY  chooseHandlerMac.label      "Choose…">
<!ENTITY  chooseHandlerMac.accesskey  "C">
<!ENTITY  chooseHandler.label         "Browse…">
<!ENTITY  chooseHandler.accesskey     "B">

<!ENTITY  unknownPromptText.label     "Would you like to save this file?">

Adding chrome/locale/branding/unknownContentType.dtd was a guess on my part. I found the file in the firefox source tree.

Any ideas?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It looks like your guess was correct and the issue is related to branding. unknownContentType.xul loads three locale files:

<!DOCTYPE dialog [
  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
  <!ENTITY % uctDTD SYSTEM "chrome://mozapps/locale/downloads/unknownContentType.dtd" >
  <!ENTITY % scDTD SYSTEM "chrome://mozapps/locale/downloads/settingsChange.dtd" >

brand.dtd is the only one that isn't part of XULRunner, it has to be supplied by the application. However, loading it apparently fails and prevents the other DTD files from loading as well (XULRunner complains about the very first entity in the dialog).

Now you don't need to put unknownContentType.dtd into your extension, it is already part of XULRunner. Other than that you've done everything correctly. However, the paths in chrome.manifest should be relative to the manifest, not to the application root. So the path probably should be locale/branding/ rather than chrome/locale/branding/. You should open chrome://branding/locale/brand.dtd in your application to verify that it has been set up correctly.

The other common issue: DTD files have to be saved in UTF-8 format without a byte order mark (BOM). If your editor saves a BOM by default then you need to reconfigure it. XULRunner will consider files starting with a BOM invalid and ignore them.

share|improve this answer
That fixed it, thanks –  nicktook Sep 21 '12 at 14:17
add comment

Your Answer


