I want to parse the following xml structure:
<?xml version="1.0" encoding="utf-8"?>
<documents>
<document>
<element name="title">
<value><![CDATA[Personnel changes: Müller]]></value>
</element>
</document>
</documents>
For parsing this element name="?????
structure I use XPath in the following way:
XPath xPath = XPathFactory.newInstance().newXPath();
String currentString = (String) xPath.evaluate("/documents/document/element[@name='title']/value",pCurrentXMLAsDOM, XPathConstants.STRING);
The parsing itself works fine, but there are just some problems with german umlauts (vowels) like "Ü", "ß" or something like this. When I print out currentString the String is:
Personnel changes: Müller
But I want to have the String like in the Xml:
Personnel changes: Müller
Just to add: I cant change the content of the xml file, I have to parse it like I get it, so I definitely have to parse everey String in the correct way.