since 1998

personal website: joe crawford. code. occasional comics. toy robots. bodysurfing. san diego. california. say hi.

phpStorm: URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)

So I was looking through ancient HTML files last night, as one does, and noted this peculiar error in phpStorm around the DTD of one of the files:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

phpStorm did not like this DOCTYPE. It reported to me:

URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)

I downloaded the dtd and entered the URI as the key and pointed to the downloaded dtd as a new schema in Schemas and DTDs.

That kind of worked, but then the <html> inspection was mad at me:

Element html must be declared

I added some related ent files referred to in the dtd.

I inspected where the other DTDs are kept, they’re in the platform-impl.jar file hidden inside ~/Library/Application Support/JetBrains/Toolbox/apps/PhpStorm/ch-0/213.5744.279/PhpStorm.app/Contents/lib but this also included a pile of other files so aping the format seemed like a nonstarter.

Ultimately the nuisance of the error for 20 year old HTML schema was not a profitable use of my time. But I have a soft spot for DTDs as tools to validate HTML. I remember hacking the HTML4 DTD so that I could validate against a DTD that included the attributes:

  1. MARGINHEIGHT
  2. MARGINWIDTH
  3. RIGHTMARGIN
  4. TOPMARGIN
  5. LEFTMARGIN
  6. BOTTOMMARGIN

… which were necessary to make Microsoft Internet Explorer and Netscape Navigator render a page with no associated margins. This was useful for the pixel-perfect implementation work I did as a web integrator working with designers who wanted designs to be as close to perfect as possible.

Today, it’s trivial to add body { margin: 0; } to your stylesheet.

But I was creating web pages before stylesheets! When single-pixel GIFs ruled the day. The days of David Siegel’s Creating Killer Websites.

If anyone gets phpStorm to behave with these old DTDs please do let me know though.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.