Pledgie
2
Pledges

Add DTD/external entity support to Firefox

By brettz9 ( 2 )

The need

Although Firefox was a pioneer in offering XML within browsers, the very basic facility of DTDs, used by many XML files for storing entities, has now become a 10-year old bug!

Such files are often used by those preparing TEI or Docbook documents and where certain symbols like copyright or accented characters are repeatedly used but for the sake of convenience, safety of character set transmission, or readability are not typed in directly each time. While Firefox does support internally-declared entities, it is quite cumbersome and difficult to maintain if one must paste in these entities for each file that uses them.

If you want to directly view in Firefox an XML document which references an external entity file, you are completely out of luck. Even Firefox’s own extension framework makes uses of the convenience of entity files, but entity resolution unfortunately does not occur for files on the web.

Specific bugs needing fixing

The most fundamental bug is that a missing entity will cause the whole file to fail, though this is against the XML specification:
https://bugzilla.mozilla.org/show_bug.cgi?id=204102

So, not only is Firefox unable to load the entities, but it won’t even show you the rest of your non-entity file content. XML does not allow this behavior, so this is a bug which should definitely be fixed.

Moreover, for those of us who do want the entity content to also be loaded, at the very least by option or user prompting (and taking into account security issues, perhaps even limiting it to loading from the same domain, though this is less than ideal and scripts are not similarly restricted), the following bug (which is admittedly really a feature request since XML doesn’t require loading of external entities) should also be addressed, as it is necessary for entities to be viewed.

https://bugzilla.mozilla.org/show_bug.cgi?id=22942

For those concerned with entity loading slowing down the browser, this can be mitigated by either being performed only at user option (less than ideal) and/or by caching external files as is done with scripts and stylesheets (and works just fine for them).

While DTD Validation is less important (and should indeed not be turned on by default), it would still be nice to have as a feature since
1) No other validation is built-in to Firefox
2) Some older XML standards are still only expressed in DTDs
3) DTD validation is relatively easy (as well as standard) compared to certain validation languages, even if it is less expressive.

https://bugzilla.mozilla.org/show_bug.cgi?id=196355

Finally, there is one other basic bug of which I’m aware which can cause problems for XML documents, in that even internal entity declarations will be ignored (and cause a single point of failure) if they are placed after an external parameter entity:
https://bugzilla.mozilla.org/show_bug.cgi?id=267350

Additional benefits

Such a universal standard as XML should not suffer from being able to be viewed and distributed on the web, whether it is use for specialized documents or data. External entities were envisioned as part of the XML standard, and at the very least, their usage should not cause a single point of failure (causing the whole document to be unviewable).

Another potential benefit of supporting the direct viewing of XML files is that specialized Firefox extensions can be made to search or browse full XML files in a variety of ways.

While Firefox understandably concentrates on the flashier features demanded by the masses such as video, faster web page rendering, etc., those of us working with rich semantic documents (often prepared with entity files) would very much like to see DTD facilities (particularly for entities) available to XML documents. As Firefox supports other XML standards, whether XHTML5, SVG, MathML, etc., these too could benefit from allowing custom entities.

Call to action

Let’s all chip in to get at least these basic XML bugs fixed in our open-source browser!

If you want to earmark your contribution for a particular bug, feel free to do so, but otherwise, with sufficient funds available, I intend to have the higher priority bugs fixed first (the first two), unless the available developer(s) are more conveniently able to work in another order.

I don’t know how much the developers may require, but I intend to find the lowest bidder who can do the job well.

Categories
Internet, Open Source and Programming Languages
Additional Information
Launched Sunday, January 10, 2010
Modified Friday, February 26, 2010

Comments (0)

Post a comment:

You must be signed in to make a comment.

We've raised $20.00, and we still need your support!
Make A Pledge

Amount:

Do not show my name on the donor's list.

What happens after I pledge?

Your contribution goes directly to the beneficiary of this campaign, no money is ever held by Pledgie.

You will appear in the donors list below after PayPal has cleared your transaction. This usually happens right away, but in some cases can take several days.

Add A Badge To Your Website
Badge: 7732
Embed Code:
Share:
More Options: Select an alternate badge design.
Donors (2)
Name Date
1. Robert Townley February 6, 2010
2. Anonymous February 8, 2010
* Denotes a manually entered pledge. Rss Feed - Subscribe to donations list