-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dom4j not parsing xml file #170
Comments
Do you get any error, wrong results or no result? YoUr sample code and the screenshot seems different, (in your sample you use ‘ instead of “ and define a default namespace). maybe provide a link to raw test data? if I had to guess, you need to turn off namespaces or filter ignoring the namespace with |
|
|
Yeah so this means parsing worked, and it’s probably the namespace support. Your sample data does not define a namespace prefix, but I think you can define them yourself |
To do what ecki suggested, try to create an XPath object with the namespaces you need. Like this DocumentFactory documentFactory = new DocumentFactory();
documentFactory.setXPathNamespaceURIs(Map.of("v1", "http://www.omninet.de/OtWebSvc/v1"));
XPath xpath = documentFactory.createXPath("//v1:Object");
List<Node> nodes = xpath.selectNodes(doc); |
Hello,
I have an xml file and I can't parse it. Could you please help with getting the data from the file.
The text was updated successfully, but these errors were encountered: