Hi I'm new to the Xerces xml parser, and would like some help loading/parsing xml documents using Xi Include.
I have two xml files, "mainxml.xml" and "includexml.xml". MainXml looks like this: <?xml version="1.0" encoding="utf-8" ?> <config xmlns:xi="http://www.w3.org/2001/XInclude"> <abc> <xi:include href="includexml.xml"> <xi:fallback> <str name="fallback include"> failure include </str> </xi:fallback> </xi:include> </abc> </config> and IncludeXml looks like: <str name="include">asd</str> I'm trying to load the MainXml file like this: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); dbf.setXIncludeAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse("mainxml.xml"); Which works ok, unless there is an error in "includexml.xml". If there is an error, then the fallback is not used - why not? An error could be en empty "includexml.xml" file, or if the xml was invalid. How do I get the fallback to be used? Thanks, Peter