Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Possible defect?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Yonas Jongkind" <yonas.jongkind AT gmail.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Possible defect?
  • Date: Mon, 2 Oct 2006 13:12:19 -0700

Having a null pointer exception while parsing documents with DTD's. Not
sure what the issue is, but I patched XOM and now it works... The error is
documented in the comment after the changed line. (this is from
XOMHandler.java near line 560).


// This method only behaves properly when called from the DeclHandler

// and DTDHandler callbacks; i.e. from inside the DTD;

// It is not intended for use anywhere in the document.

*protected* *boolean* inInternalSubset() {

*if* (!usingCrimson && !inExternalSubset) *return* *true*;

String currentURI = locator.getSystemId();

*if* (currentURI == *this*.documentBaseURI) *return* *true*;

*if* (currentURI != *null* && currentURI.equals(*this*.documentBaseURI)) *
return* *true*;

// YXJ: WAS: if (currentURI.equals(this.documentBaseURI)) return true;

*return* *false*;

/* Fixed to address throw:

Caused by: java.lang.NullPointerException

at nu.xom.XOMHandler.inInternalSubset(XOMHandler.java:554)

at nu.xom.XOMHandler.attributeDecl(XOMHandler.java:571)

at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.attributeDecl(
AbstractSAXParser.java:951)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor.attributeDecl
(XMLDTDProcessor.java:1082)

at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanAttlistDecl
(XMLDTDScannerImpl.java:1246)

at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(
XMLDTDScannerImpl.java:1983)

at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSubset
(XMLDTDScannerImpl.java:320)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch
(XMLDocumentScannerImpl.java:1169)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next
(XMLDocumentScannerImpl.java:1066)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next
(XMLDocumentScannerImpl.java:986)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(
XMLDocumentScannerImpl.java:645)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:508)

at com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(
DTDConfiguration.java:496)

at com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(
DTDConfiguration.java:552)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java
:107)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(
AbstractSAXParser.java:1205)

at nu.xom.Builder.build(Builder.java:1127)

... 39 more

which occured while performing DTD handling for:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

*/

}



--
Life is good!




Archive powered by MHonArc 2.6.24.

Top of Page