• 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
XMLNextSibling is there an easier way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XMLNextSibling is there an easier way


  • Subject: XMLNextSibling is there an easier way
  • From: Jim Skibbie <email@hidden>
  • Date: Wed, 30 Apr 2008 12:33:43 -0500
  • Thread-topic: XMLNextSibling is there an easier way

Title: XMLNextSibling is there an easier way
I have an XML file that has multiple repeating <ROW> tags. I’m parsing it using the AppleScript XMLLib OSAX and need to find the text of the Value element in the Row element where the value of the IDNoSetItemParent is 6353368.

I’m using the commands:

   
set theDoc to XMLOpen XMLfile
   set the_root to XMLRoot theDoc
   set CustomFieldPath to XMLXPath the_root with "ROW/IDNoSetItemParent[. = \"6353368\"]"

Which gets me to here:         <IDNoSetItemParent>6353368</IDNoSetItemParent>

I need to get the text of the Value element that is three siblings below that, so I’m looping the command:

   
    repeat with i from 1 to 3
            set CustomFieldPath to XMLNextSibling CustomFieldPath
       end repeat
   
    set setValue to (XMLGetText item 1 of CustomFieldPath)

Does anyone know if there is a simpler XMLXPath command that works with XMLLib to go down three siblings from the first ? I tried following-sibling, but that does not yield an XMLRef

Thanks.
Jim


<?xml version="1.0" encoding="UTF-8"?>
<FMPDSORESULT>
    <ROW MODID="0" RECORDID="13381415"/>
    <ROW MODID="1" RECORDID="13381416"/>
    <ROW MODID="1" RECORDID="13381417">
        <FieldLabel>VAR Program #</FieldLabel>
        <IDNoCustomField>6353376</IDNoCustomField>
        <IDNoCustomFieldLabel/>
        <IDNoJob>021521</IDNoJob>
        <IDNoLocation>3007</IDNoLocation>
        <IDNoSet/>
        <IDNoSetItemParent>6353368</IDNoSetItemParent>
        <ItemLetter>A</ItemLetter>
        <SortOrder>6.5</SortOrder>
        <Value>VARnumber</Value>
    </ROW>
</FMPDSORESULT>
 _______________________________________________
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: XMLNextSibling is there an easier way
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: choose from list re-visited - again
  • Next by Date: Entourage and scripting exchange account public folders
  • Previous by thread: Re: Record/List Coercion
  • Next by thread: Re: XMLNextSibling is there an easier way
  • Index(es):
    • Date
    • Thread