vinodat / xmlwise

Automatically exported from code.google.com/p/xmlwise
0 stars 0 forks source link

Plist.load does not parse output of system_profiler on osx #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. save output of system_profiler command on osx to a file. i.e. 
"system_profiler SPSerialATADataType -xml > /tmp/tmp.tmp"
2. Map<String, Object> map = Plist.load(new File("/tmp/tmp.tmp");
3. XmlParseException is thrown "plist.XmlParseException: Unexpected number of 
elements of type dict in element <plist>"

What is the expected output? What do you see instead?
the system_profiler output starts with an array rather than a dict and you 
should be able to parse this fomat
for example

<?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">
<array>
        <dict>
                <key>_SPCommandLineArguments</key>
                <array>
                        <string>/usr/sbin/system_profiler</string>
                        <string>SPSerialATADataType</string>
                        <string>-xml</string>
                </array>
                <key>_SPCompletionInterval</key>
                <real>0.15995395183563232</real>
                <key>_dataType</key>
                <string>SPSerialATADataType</string>
                <key>_detailLevel</key>
                <integer>-1</integer>
                <key>_items</key>
                <array>
                        <dict>
                                <key>_items</key>
                                <array>
...

What version of the product are you using? On what operating system?
xmlwise-1_1-r9.jar
Mac OS X 10.7.1

Please provide any additional information below.

Original issue reported on code.google.com by rob...@gmail.com on 22 Oct 2011 at 2:50

GoogleCodeExporter commented 8 years ago
Sorry, just noticed that loadObject is already included and can parse a 
system_profiler type of plist.
Comments on load() and loadObject() both say "using default mapping" so at 
first I though they would both fail if the top child was not a dict.

Original comment by rob...@gmail.com on 22 Oct 2011 at 6:44

GoogleCodeExporter commented 8 years ago
Closing this bug then

Original comment by christof...@gmail.com on 20 Nov 2011 at 4:34