Re: false/false illegal setting for namespaces is permitted

Nic Ferrier <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.xml
Message-ID <[email protected]>
"Paul Brown" <[email protected]> writes:

> > From: [email protected]
> > [mailto:[email protected]]
> > "Paul Brown" <[email protected]> writes:
> > > As part of a project, I put together a feature/property
> > > checker, and one of the things that it spotted is that
> > > GNU JAXP allows the illegal namespaces=false,
> > > namespace-prefixes=false setting.
> > Hmmm... that sounds fairly simple to fix.
> > Want to have a crack at it?
> 
> As long as it is agreed that this is the Right Thing To Do.
> Implementing the features as in the SAX "spec" would require that:
> 
> 1) If namespace-prefixes is false, then setting namespaces to false is
> an error; and vice versa.

At parse time. This probably needs testing: what does aelfred do if
both are set to false? Do we get a good exception or is it hidden in
some way?


> 2) Default is n=T,n-p=F.  So the naive namespace disablement action
> (namespaces=false) will result in an error.

That's probably right, as above, I think it needs to be tested. Can
you do that?

 
> The next two questions:
> 
> 1) Should the exception be thrown only on parse (to avoid the problem in
> 2 above)?

Possibly. If we don't already throw one and the parse fails.


> 2) Is SAXNotSupportedException the right exception to throw?

Almost certainly not. A parse failure seems to me more reasonable
because the error is really "what should I do with ns information
now?"


Does that make sense?


Nic
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.