Hi, Using Dom4J 1.6.1 and Java 1.6.
I can't seem to be able to read an xi:include inside a war: Here's a snippet: SAXParser parser = factory.newSAXParser(); SAXReader reader = new SAXReader(parser.getXMLReader()); final InputStream inputStream = getClass().getResourceAsStream(_filePath); <--- _filepath = /master.xml Document _doc = reader.read(inputStream); inside the xml: <xml....> <somestuff> <xi:include href="xml/a.xml" /> It's reading the xml, but when it tries to do the xi:include, I get this error: org.dom4j.DocumentException: Error on line 39 of document : An 'include' failed, and no 'fallback' element was found. Nested exception: An 'include' failed, and no 'fallback' element was found. at org.dom4j.io.SAXReader.read(SAXReader.java:482) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at me.somewhere.load(GameModel.java:423) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Nested exception: org.xml.sax.SAXParseException: An 'include' failed, and no 'fallback' element was found. 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.xinclude.XIncludeHandler.reportError(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.reportFatalError(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.reportFatalError(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) The WAR is structured like: / WEB-INF/classes/master.xml <------ the root xml with the xi:include WEB-INF/classes/xml/a.xml <------ the file I'm trying to include I've tried for the xi:include: <xi:include href="/WEB-INF/classes/xml/a.xml" /> <xi:include href="./xml/a.xml" /> none seems to work Anyone can help here please? It's stopping me deploying something. Thanks in advance! -=david=- ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user