• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: xml text to record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xml text to record


  • Subject: Re: xml text to record
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 22 Nov 2011 14:11:26 -0600

I have tried more experimenting. Here's the script ...

on run
do shell script "drutil list -xml"
set response to the result -- text in xml format
log response -- So you can see what you are doing
tell application "System Events"
set xmlData to (make new XML data with data response) --> «class xmld» = XML data
-- count XML elements of xmlData --> 1
XML elements of xmlData --> list
item 1 of the result --> «class xmle», no elements, no attributes

end tell
log the result
end run

The logged response is ...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE  [
    <!ELEMENT deviceList (device)*>
    <!ELEMENT device (vendor, product, firmware, interconnect, support)>
    <!ATTLIST device index CDATA #IMPLIED>
    <!ELEMENT vendor EMPTY>
    <!ATTLIST vendor name CDATA #REQUIRED>
    <!ELEMENT product EMPTY>
    <!ATTLIST product name CDATA #REQUIRED>
    <!ELEMENT firmware EMPTY>
    <!ATTLIST firmware revision CDATA #REQUIRED>
    <!ELEMENT interconnect EMPTY>
    <!ATTLIST interconnect name CDATA #REQUIRED>
    <!ELEMENT support EMPTY>
    <!ATTLIST support level (appleShipping|appleSupported|vendorSupported|unSupported|notSupported) #REQUIRED>
]>

<deviceList>
    <device name="PIONEER DVD-RW DVR-K06" index="1">
        <vendor name="PIONEER"/>
        <product name="DVD-RW  DVR-K06"/>
        <firmware revision="Q614"/>
        <interconnect name="ATAPI"/>
        <support level="appleShipping"/>
    </device>
    <device name="PIONEER DVD-RW DVR-110D" index="2">
        <vendor name="PIONEER"/>
        <product name="DVD-RW  DVR-110D"/>
        <firmware revision="1.17"/>
        <interconnect name="FireWire"/>
        <support level="appleShipping"/>
    </device>
</deviceList>

It looks as if there is an xml element named "deviceList", but, there isn't.
The only xml element I can get has no value, no name and no id.
It is simply not possible to read any data from "xmlData".

Perhaps someone with more experience with xml sees something that I don't.
I am at a dead-end with this particular 'drutil' command.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: xml text to record
      • From: Axel Luttgens <email@hidden>
References: 
 >xml text to record (From: Luther Fuller <email@hidden>)
 >Re: xml text to record (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: xml text to record
  • Next by Date: Re: Finder "Hide Others"
  • Previous by thread: Re: xml text to record
  • Next by thread: Re: xml text to record
  • Index(es):
    • Date
    • Thread