XMLNextSibling is there an easier way
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