cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <cross...@indexgeo.com.au>
Subject Re: xconf tool, entity resolver, and new build options
Date Fri, 23 May 2003 03:55:34 GMT
Marc Portier wrote:
>
> David,
> dear friend and colleague Bruno was actually suggesting to have 
> the parser not taking the DTD into account at all

The trouble is that if a DTD is declared in the input file,
then the parser has to resolve it, whether or not validation
is happening.

> underlaying question being if we really do want to maintain local 
> copies of all involved DTD's? (even apart from the licensing 
> issues surrounding it, this could become a management issue?)

That is right - we definitely do not want to keep copies of
these DTDs unless we must.

> and while typing this I start to realize there are even more 
> reasons on a technical level NOT to consider the DTD in this 
> patch-process:
> 1. the DTD will not be applied to ensure valid output (the 
> serializer doesn't do that)
> 2. the DTD will only be applied to confirm validity of the input 
> which in this case might very well incomplete since we want to 
> patch it anyway?

We are not attempting any validation of input or output.
Just trying to parse an xml file.

> 3. introducing the DTD might lead to introduction of the default 
> attribute setting (which isn't wrong, but a bit more then we want 
> to achieve, and getting maybe confusing for end-users)

Is this really a problem? Would users be looking at the
final xpatched web.xml file?

> so if we want valid docs in our proces we should have a 
> <validate> after the <xpatch> anyway

Forget xml validation - it is not the concern of XConfToolTask.

> to get there: not looking at the DTD could be done with
> 
> builder.setFeature("http://xml.org/sax/features/validation", false)

> builder.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",

> false)
> 
> allthough the last one might be only supported by Xerces.
> (see 
> http://xml.apache.org/xerces2-j/features.html#nonvalidating.load-external-dtd)

Am i right that xerces is not the parser being used in
XConfToolTask.java ? Anyway, i tried to add these "setFeatures"
but got compilation errors.

By the way, i now have the entity resolver working properly
with XConfToolTask, so if we need to then we can implement that.

> being really pragmatic: just dropping the DOCTYPE line in the 
> input docs should achieve the same :-/

That sounds like a good approach. However, Geoff mentioned
that the document type declaration might be required in web.xml
If it is not, then your suggestion might be the way to go.

In the back of my mind i keep thinking about Jeff Turner's
DoctypeChanger, which may be useful if we need to automatically
remove the declaration.


--David


Mime
View raw message