ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Li <>
Subject Re: [PATCH to Bug 625] Incorrect handling of External Entity...
Date Sat, 17 Feb 2001 07:59:59 GMT

  Thanks for the response. 

I attached another patch that solves both of our problems. Basically,
the patch create a InputSource from a FileInputStream so your problem
with filename with # being used as URI fregment won't exist. The
systemId set on the InputSource so the parser can read the System Entity

I believe this compilant toh the External Entity (4.2.2) in the XML

Right the sentence you quoted below refering to the System Entity.

"meant to be dereferenced to obtain input for the XML processor to
construct the entity's replacement text.] ... relative URIs are relative
to the location of the resource within which the entity declaration

According to the above, if a system entity is define in
file:/foo/bar/build.xml. It should be dereference to
file:/foo/bar/ I believe patch implements this semantics.

Regarding to the in the Log4J distribution. I think the
development team has forgotten to include it in the tar/zip
distribution. I got it from the CVS.

David Li

Conor MacNeill wrote:
> David,
> Sorry, I saw your earlier post on this subject but didn't get around to
> addressing it. I am not an expert on XML entity declarations but I did some
> background research on this.
> Firstly, let me point you to this patch, applied about a month ago which is
> the reverse of the first part of your patch
> tools/ant/
> Now I believe that patch was to prevent a # in a directory name being
> interpreted as a URL fragment separator. This used to fail and I can only
> assume that JAXP is converting the File object in this call
> public void parse(File file, HandlerBase base)
> into a file: URL and then invoking
> public void parse(String uri, HandlerBase base)
> Maybe, that is not a good approach.
> According to the XML spec, the SystemLiteral is a URI as defined in
> RFC2396/RFC2732. I am not sure how the XML parser will interpret the
> in
>     <!ENTITY SYSTEM "">
> as a URI.
> The second part of your patch is in an if block
>             if (systemId.startsWith("file:")) {
> so it is unlikely that "" will trigger the changed code. I would
> be inclined to change your "" to "" as presented in
> the FAQ. Otherwise, we would have to exclude directories which include the
> # character from being used with Ant. To quote the original bug report
> "This bug is particularly nasty for us since we use the Continuus
> configuration management system which likes to place projects under a
> directory named projectName#userName. This bug renders ANT unusable in our
> environment. "
> Also, to test this I checked out log4j and did not find the exact
> construction you mention. I did find a lot of references to but
> no itself.
> I'd be interested in comments on this. My inclination is to say this is not
> a bug.
> Conor
View raw message