RosettaCodeData/Task/XML-XPath/AutoHotkey/xml-xpath-2.ahk
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

15 lines
438 B
AutoHotkey

#Include xpath.ahk
xpath_load(doc, "xmlfile.xml")
; Retrieve the first "item" element
MsgBox % xpath(doc, "/inventory/section[1]/item[1]/text()")
; Perform an action on each "price" element (print it out)
prices := xpath(doc, "/inventory/section/item/price/text()")
Loop, Parse, prices,`,
reordered .= A_LoopField "`n"
MsgBox % reordered
; Get an array of all the "name" elements
MsgBox % xpath(doc, "/inventory/section/item/name")