Java Plist XML Parsing

Posted by Jannis on Stack Overflow See other posts from Stack Overflow or by Jannis
Published on 2010-03-15T23:23:50Z Indexed on 2010/03/15 23:29 UTC
Read the original article Hit count: 1207

Filed under:
|
|

Hello everyone,

I'm parsing a (not well formed) Apple Plist File with java.

My Code looks like this:

InputStream in = new FileInputStream( "foo" ); 
XMLInputFactory factory = XMLInputFactory.newInstance(); 
XMLEventReader parser = factory.createXMLEventReader( in ); 
while (parser.hasNext()){    
XMLEvent event = parser.nextEvent();    
  //code to navigate the nodes 
}

The parts I"m parsing are looking like this:

<dict>    
  <key>foo</key><integer>123</integer>
  <key>bar</key><string>Boom &amp; Shroom</string>
</dict>

My problem is now, that nodes containing a ampersand are not parsed like they should because the ampersand is representing a entity.

What can i do to get the value of the node as a complete String, instead of broken parts?

Thank you in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml