Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XMLFilter and Builder.setupParser(), knownGoodParser()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XMLFilter and Builder.setupParser(), knownGoodParser()
  • Date: Thu, 28 Oct 2004 11:13:54 -0700

On Oct 28, 2004, at 10:01 AM, Elliotte Harold wrote:

Wolfgang Hoschek wrote:

Builder.setupParser() and knownGoodParser() do some checks for known parsers ala
if (parser.getClass().getName()) { ... special configure ...}
If the parser is a SAX XMLFilter then this would not really help, so the suggestions is to have the code in these methods check if the parser is an instanceof XMLFilter and walk the parser tree via getParent() until a parser is found that is not an instanceof XMLFilter.

The problem is that XML filters can and routinely do violate well-formedness constraints, even when the underlying real parser does not. I special case one common filter that I trust not to violate XML's well-formedness rules (Norm Walsh's catalog filter) but I'm not willing to extend this courtesy to all filters everywhere.

Right, but for example it might be good to do the following even if getParserName(...) yields Crimson

if (parser.getClass().getName().equals( // Crimson workaround
"org.apache.crimson.parser.XMLReaderImpl")) {
parser.setErrorHandler(
new NamespaceWellformednessRequired()
);


Above snippet is from Builder.setupParser()

Wolfgang.





Archive powered by MHonArc 2.6.24.

Top of Page