[OffTopic] DTD and entities in XUL files

May 18, 2009 at 10:49 AM

Hey hey,

i just realized that there is still a big problem when it comes to validation of xul-documents in Visual Studio.

When you localize your xul-file using a DTD, Visual Studio won't accept it because of the chrome-URI.


<!DOCTYPE window SYSTEM "chrome://myApp/locale/main.dtd">

will give the following error: "The URI prefix is not recognized"

Even if we could register the prefix somehow, Visual Studio has no way to know about the entities, as it doesn't know how the chrome protocol works.

i know we can't solve this via the schema, but i thought i'll ask you, maybe you have an idea.


May 21, 2009 at 9:43 AM

Unfortunately I don't know. VS add-in would probably be able to solve it, but I don't know what kind of work would be involved in that.




Aug 12, 2012 at 10:09 PM
Edited Aug 12, 2012 at 10:13 PM

I'm using a little trick to solve this problem - instead of using full chrome URI use relative path:

<!DOCTYPE window [
	<!ENTITY % brandDTD SYSTEM "../locale/en-US/brand.dtd">
	<!ENTITY % xpcomviewerDTD SYSTEM "../locale/en-US/xpcomviewer.dtd">

I know that looks pretty uncomfortable but you can add multi-replacement task to your build file so you will not to do this manually every time you're building XPI package.