Project

Profile

Help

Bug #1627

closed

ClassCastException thrown when constructing documents with treemodel:XOM

Added by O'Neil Delpratt over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Low
Category:
XOM interface
Sprint/Milestone:
-
Start date:
2012-09-12
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

In saxon the construction of XOM document, typically, as the result of a transformation the exception

ClassCastException is thrown when we are adding a comment or a processingInstruction node to a Document node:

Exception in thread "main" java.lang.ClassCastException: nu.xom.Document cannot be cast to nu.xom.Element
	at net.sf.saxon.option.xom.XOMWriter.processingInstruction(XOMWriter.java:207)
	at net.sf.saxon.event.ReceivingContentHandler.processingInstruction(ReceivingContentHandler.java:500)
	at org.apache.xerces.parsers.AbstractSAXParser.processingInstruction(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.processingInstruction(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:389)
	at net.sf.saxon.event.Sender.send(Sender.java:162)
	at net.sf.saxon.Configuration.buildDocument(Configuration.java:3381)
	at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:370)
	at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:385)

Fix applied to the XOMWriter class. We now create a stack of the inherited class ParentNode.

Actions #1

Updated by O'Neil Delpratt over 11 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 9.4.0.6

Please register to edit this issue

Also available in: Atom PDF