commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@dfki.de>
Subject [digester] can't resolve relative entities ?
Date Sat, 27 Mar 2004 00:31:52 GMT

Dear Digester-Gurus...

While trying really much to resolve the possible responsability of a 
buggy dom4j in errors to resolve entities in maven project parsing, I 
finally realize that Digester may be the reason.

We start with a guess: Digester.parse(File) is weird (around lines 
1527...): it doesn't store, at all, the reference to the file but still 
offers himself as EntityResolver. How can it resolve an entity if it 
doesn't know the path ??

The pathology appears very while building taglibs of jelly: the 
project.xml of each taglibs, extends ../taglib-project.xml which itself 
should reference, by means of DTD-internal-subset ../commonDeps.ent.
As this is buggy, the current jelly CVS contains a copy of 
commonDeps.ent.

Digging into the source, I realize that the place where it leaves the 
maven sources is in MavenUtils line 190 (at the beginning of 
getNonJellyProject(). Inserting something the code below right before 
the call to getProjectBeanReader().parse() proved me that the whole 
logic of relative URLs runs fine... (even the stream opens)...

		URL u = new URL("file://" + projectDescriptor.getAbsolutePath());
		System.out.println("Will parse project: " + u);
		if (projectDescriptor.getName().equals("tag-project.xml")) {
			URL u2 = new URL(u,"../commonDependencies.ent");
			System.out.println("CommonDeps should be at " + u2);
			System.out.println("Stream: " + u2.openStream());
		}

Can someone at least comment on my guess about the inappropriate 
construction of the entity-resolver ? I think one needs to create a new 
one for every new URL handed-out to the digester, or ?

paul


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message