I am parsing an (not quite formed) Apple Plist file with java.
My code is as follows:
InputStream in = new FileInputStream( "foo" );
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLEventReader parser = factory.createXMLEventReader( in );
while (parser.hasNext()){
XMLEvent event = parser.nextEvent();
}
The parts that I take apart look like this:
<dict>
<key>foo</key><integer>123</integer>
<key>bar</key><string>Boom & Shroom</string>
</dict>
My problem is that the nodes containing the ampersand are not parsed as they should, because the ampersand represents the object.
What can I do to get the value of node as a complete string, instead of broken parts?
Thanks in advance.
source
share