[Project_owners] Using application DTD files in Cross browser extensions.

Philip Chee philip.chee at gmail.com
Thu Jun 15 21:42:17 EDT 2006


On Fri, 5 May 2006 05:05:34 -0700 (PDT), Eric H. Jung wrote:

>>> However I find that the underlying engine if it finds a .dtd file
>>> missing, it will silently fail and skip the rest of the
>>> declarations even though there is a valid DTD file further down.
>>> Phil
>> I've seen that too

> In the example provided by Neil, you're leveraging XML entities to
> "include" multiple DTDs. I doubt if the XML parser actually defines two
> DOCTYPEs as per my original question. However, it gets the job done for
> i18n... I just wouldn't depend on it for formally defining multiple
> DOCTYPEs without some testing of my own.

Summary: I want to make an extension that works in both Firefox and
SeaMonkey. I also want to make use of entities in the FF/SM DTD files to
avoid having to get my own extension/locale/xx-YY/www.dtd files for each
and every locale so I try to do something like this:

<!DOCTYPE overlay [
  <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
  %browserDTD;
<!ENTITY % viewZoomOverlayDTD SYSTEM
"chrome://communicator/locale/viewZoomOverlay.dtd">
  %viewZoomOverlayDTD;
]>

The textZoom* entities reside in these files for Firefox (browser.dtd)
and SeaMonkey (viewZoomOverlay.dtd). However the above example will fail
in SeaMonkey as "chrome://browser/locale/browser.dtd" doesn't exist in
SM. Apparently once the Gecko engine fails to find a dtd file, it skips
the rest of the declarations with no warnings or errors. If I switch the
two around then the extension fails in Firefox.

I tried Neil's suggestion of pointing to one .DTD file and in that file
to import other DTD files like so:

.../myextension/content/viewzoom.dtd:

<!ENTITY % viewZoomOverlayDTD SYSTEM
"chrome://communicator/locale/viewZoomOverlay.dtd">
%viewZoomOverlayDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;

However this also suffers from the same problem. So is there any
solution other than to carry 22 different language locales with the
attendant bloat?

Phil
-- 
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]I find push buttons very depressing......
* TagZilla 0.059


More information about the Project_owners mailing list