see subject. This was executed on a file with the following path (on Mac OSX):
/Volumes/RobExtL/xmltests/hurz#1/hurz.xml
This is a valid path.
The message indicates that the JDK parser somehow cannot deal with the "#" in the filename and cuts everything starting with it off.
The same file can be parsed using JDOM2 without any problems. The reason I am not using JDOM2 here is that this is a utility that only determines the root element name using SAX to avoid parsing potentially huge files, which in this case is performance-critical.
Stacktrace should contain all remaining information necessary.
Exception in thread "main" java.io.FileNotFoundException: /Volumes/RobExtL/xmltests/hurz (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:623)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:805)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1140)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:655)
at de.lesspain.xml.XML.getRootElementName(XML.java:69)
at de.lesspain.xml.XML.hasRootElement(XML.java:80)
at XMLEntityManagerErrorTest.main(XMLEntityManagerErrorTest.java:15)
Thanks in advance for any hints, Best