• 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: Help parsing XML file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help parsing XML file


  • Subject: Re: Help parsing XML file
  • From: "Steven D. Majewski" <email@hidden>
  • Date: Fri, 7 Mar 2008 19:49:07 -0500


On Mar 7, 2008, at 6:42 PM, Jim Skibbie wrote:

AWESOME!!

I don't get why the straight XPath expression
"/FMPDSORESULT/ROW/ValueColor01" doesn't work, but your solution did the
trick. I added the "01" onto the end of your ValueColor so I would only get
the ones that relate to each other.


Thanks a million!

Jim



I think that is probably a namespace issue.
You have a declaration for the default namespace in the data file,
but you're probably not using the namespace in the xpath selection.
There really is a difference between NO NAMESPACE and the DEFAULT NAMESPACE,
even though they may both be "spelled" the same way in different contexts.


A simple test would be to remove the: xmlns="http://www.filemaker.com/ fmpdsoresult"
from a copy of your data file and see if what you're trying works.
If removing the namespace from the data fixes the problem, then it's a namespace
problem, and I can give you additional (but more complicated) tips on how
to express the namespace properly in your xpaths.



-- Steve Majewski / UVA Alderman Library



From: Rainer Standke <email@hidden>
Date: Fri, 7 Mar 2008 15:27:42 -0800
To: Jim Skibbie <email@hidden>
Cc: "email@hidden" <applescript- email@hidden>
Subject: Re: Help parsing XML file


It seems to have to do with how the open tags are formed. This one
asks for all tags that start with ROW and have children with names
starting with ValueColor:

set x to XMLXPath the_root with "*[starts-with(name(),'ROW')]/* [starts-
with(name(),'ValueColor')]"


--> {"Process", "Process", "Process", "Process", "150", "150", "150",
"150", "Yellow", "Magenta", "Cyan", "Black"}

I guess you might want to look into finessing the XPath request so
that it yields what you are looking for. It's a lot deeper and more
powerful than I used to think for a long time. Probably still is...

Rainer

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


This email sent to email@hidden


_______________________________________________
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: Help parsing XML file
      • From: Jim Skibbie <email@hidden>
References: 
 >Re: Help parsing XML file (From: Jim Skibbie <email@hidden>)

  • Prev by Date: Re: Do Shell script with unix sub command and CocoaDialog
  • Next by Date: Re: Help parsing XML file
  • Previous by thread: Re: Help parsing XML file
  • Next by thread: Re: Help parsing XML file
  • Index(es):
    • Date
    • Thread