The document type declaration for root element type "plist" must end with '>'



I have such header of xml file :



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://ift.tt/vvUEPL"/>

<plist version="1.0">
<dict>
<key>frames</key>
</dict>
</plist>


I want to use org.w3c.dom.Document to read it. When I parse it in this code



DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(path);


I get following exception:



[Fatal Error] atlas_ID117.plist:2:102: The document type declaration for root element type "plist" must end with '>'.
Exception in thread "main" java.lang.NullPointerException
at main.PlistReader.findFramesList(PlistReader.java:36)
at main.PlistReader.<init>(PlistReader.java:32)
at main.Main.main(Main.java:12)


As a result builder.parse method returns null. But I can't change xml file!


How to solve this?


No comments:

Post a Comment