Skip to content

Instantly share code, notes, and snippets.

@sshaw sshaw/bad.plist
Created Jun 15, 2018

Embed
What would you like to do?
Example of Apple Property List (Plist) DTD Validation With xmllint
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>A</key>
<key>B</key>
<string>sshaw</string>
<string>DDEX</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>A</key>
<string>sshaw</string>
</dict>
</plist>
~/code/ruby/class2 >xmllint --noout --valid ~/Desktop/good.plist
~/code/ruby/class2 >xmllint --noout --valid ~/Desktop/bad.plist
/Users/sshaw/Desktop/bad.plist:9: element dict: validity error : Element dict content does not follow the DTD, expecting (key , (array | data | date | dict | real | integer | string | true | false))*, got (key key string string )
</dict>
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.