[ http://issues.apache.org/jira/browse/JCR-666?page=comments#action_12456407 ] Jukka Zitting commented on JCR-666: -----------------------------------
> Can the ImportHandler support pluggable EntityResolver? You'll probably want to use Session.getImportContentHandler() and wrap the returned ContentHandler into a custom DefaultHandler subclass that implements the custom entity resolution rules you need. Then instantiate a SAXParser and use that with your custom DefaultHandler to parse the document and get the contents written into the repository. > Importing XML with character entities fails > ------------------------------------------- > > Key: JCR-666 > URL: http://issues.apache.org/jira/browse/JCR-666 > Project: Jackrabbit > Issue Type: Bug > Components: xml > Affects Versions: 1.1.1 > Reporter: Yoav Landman > Assigned To: Jukka Zitting > Priority: Critical > > Importing XML files that contain character entities fails on entity resolving. > Try, for example, importing this fragment: > <name>aøb</name> > You will get: > Caused by: org.xml.sax.SAXParseException: The entity "oslash" was referenced, > but not declared. > at > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown > Source) > at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown > Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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 org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) > at > org.apache.jackrabbit.core.SessionImpl.importXML(SessionImpl.java:1085) > ... 53 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
