Re: [xml] Problem with public entity references



On Tue, Feb 14, 2012 at 14:06, Liam R E Quin <liam holoweb net> wrote:
On Tue, 2012-02-07 at 14:08 +0100, Nikolai Weibull wrote:
What is going wrong here? Â(Example files minimized to show the problem.)

It looks like there are some bugs, however...

a.dtd:
<!ENTITY % a PUBLIC "-//a//b//c" "">

so the SYSTEM identifier of %a is actually "a.dtd", and system
identifers override public ones, so %a; includes a.dtd. I don't think
this is a bug.

Well, I did add prefer="public" to the catalog in my follow-up, so it
should be preferring the public identifier, but itâs not.

The bug that I see is that if your system identifier is "-//a//b//c"
then xmllint doesn't obey the rewrite rule in the catalog, but tries to
open a file called "-/a/b/c" -- probably it is doing hierarchical URI
canonicalisation *before* checking the catalog.

"-//a//b//c" is a public identifier, not a system identifier, so I
donât see how any of this is correct.

In general, stay away from XML public identifiers if you can. They were
a mistaken feature in the spec, not needed at all, and will only cause
you problems!

I wish it were that simple.  The problem is that this is something
that occurs in a clientâs files.  I currently have to manually (well,
outside of the XML tool-chain, anyway) modify their files before
processing them.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]