• 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: Aaaarrrggghhh XML!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aaaarrrggghhh XML!


  • Subject: Re: Aaaarrrggghhh XML!
  • From: Roger Howard <email@hidden>
  • Date: Wed, 23 Feb 2005 08:56:25 -0800


On Feb 23, 2005, at 5:46 AM, Martin Orpen wrote:

Is there an easy method to drill down through XML data and present the tags
and contents in a readable form such as "tag name: value"?


I'm doing this with Photoshop's metadata at the moment. Looping through a
list of tags and contents is easy enough:


    set myList to {}
    set end of myList to XML namespace uri of item 1 of c & return
    repeat with n from 1 to count of items in c
        set t to XML tag of item n of c
        set d to XML contents of item n of c
        set end of myList to t & ": " & d & return
    end repeat

(Using LateNite's XML Tools osax)

Which is OK for simple stuff, but as soon as you hit XML contents with
nested XML data you get errors :-(

Unfortunately, I can't guarantee the XML content so will need to have a
solution that can work with some deeply nested data.

Before I start writing handlers for this I thought I'd ask if anybody has
already got this sorted?

Martin,

I've done limited work with AppleScript and XMP; while XML Tools works, it does get a bit heady with documents like XMP. What I found easiest was to transform the XMP using a style sheet (XSLT), and then work with that (either using XML Tools, or even by transformaing the XMP to a simpler, non-XML format). I'm not sure if I've got a copy of any of these style sheets here, but I'll dig em up if I can.

-R

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Aaaarrrggghhh XML!
      • From: Martin Orpen <email@hidden>
References: 
 >Aaaarrrggghhh XML! (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: shell script and text manipulation
  • Next by Date: Re: Dock Q...
  • Previous by thread: Aaaarrrggghhh XML!
  • Next by thread: Re: Aaaarrrggghhh XML!
  • Index(es):
    • Date
    • Thread