On XML Catalogs

| 5 Comments | No TrackBacks

XML.com has published good article "Using XML Catalogs with JAXP". XML Catalogs are successors of SGML Catalogs and in simple words it's a system for defining resolving of resource identifiers (URIs or Public Identifiers) in XML. If you are .NET minded - it's about having XML document (called catalog), where you declaratively define how URIs in DOCTYP, xsi:schemaLocation, xsl:include/xsl:import/document() etc should be resolved by XmlResolver. So instead of writing you own XmlResolver you declare that "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" should be resolved as "C:/dtds/xhtml1-strict.dtd" in catalog file and get things done.

Very useful. I hooked on catalogs when working with big DTDs such as Docbook. Validate against huge DTD or schema loading it from the Web isn't good idea and catalogs here is a feature one cannot work without. It's a shame there is still no .NET implementation. Basically that's on my to-do list for almost a year, still close to bottom :( There was some showstopper related to PUBLIC identifier, but I don't remember exactly what the the problem was. It's still tempting to implement it. Probably that's going to be my next pet project after I finish EXSLT article I'm writing. Anybody interested to participate?

Related Blog Posts

No TrackBacks

TrackBack URL: http://www.tkachenko.com/cgi-bin/mt-tb.cgi/182

5 Comments

Sorry, Andrew, no news from me. Could you please explain why you need it?

Has there been any progress on this front? Is there an XmlResolver that works with OASIS catalog file?

FYI, I've created an XmlCatalogResolver class that parses our catalog file and works with our scripts. Let me know if you would be interested in seeing this, although be forewarned I was working on a very tight deadline and as such it isn't very generic.

Well, somehow I also remember something like that, but I just tried it again with XmlTextReader and looks like everything is ok - XmlResolver is called to resolve PublicID.

I too need a .NET XmlResolver that supports catalog lookup. I was wondering if you've made any progress on this? If not, perhaps I can share my implementation of it with you. I'm just getting immersed into how this would be done, but the problem you hinted at might be that the public identifier never gets passed to the XmlResolver, only the system identifer? (I'm not certain about this, but it's my hunch.)

Thanks!
Jonathan Evraire
jonevrai@justice.gc.ca

Leave a comment