# Help with XMLDomWrapper

## Recommended Posts

I just can't get this working....... :">

i've been on this for 3 days now and i have come to the conclusion that i must be stupid

Could someone please help me out on this as i have read (probably not understood) every post in the XMLDomwrapper thread in scripts and scraps and tried to acheive what i wanted using varients of each of the examples all with no success. Then i came to the code posted by eltorro in answer to hermherm...this is exactly what i want..unfortunatly i'm too stupid to make it work.

This is what i have so far...

#Include <_XMLDomWrapper.au3>
#include <Array.au3>

main()
func main()
Local $sFile = "item.xml" If FileExists($sFile) Then
$ret = _XMLFileOpen ($sFile)
if $ret =0 then Exit$id = _XMLGetValue ("realdata/item/id")
$desc = _XMLGetValue ("realdata/item/desc")$price = _XMLGetValue ("realdata/item/price")

MsgBox(4096, "test", $desc[1]) MsgBox(4096, "Error", _XMLError ()) EndIf EndFunc and this is the xml i am trying to read <?xml version="1.0" ?> - <RealData> <MSG ID="9">offline</MSG> - <ITEM> <ID>1220902</ID> <DESC>Item Description</DESC> <PRICE CURRENCY="GBP">999.99</PRICE> <QTY>5</QTY> <DELDATE>2006-10-04</DELDATE> </ITEM> </RealData> All i want is to be able to get these into simple variables...the answer just escapes me.. Please can someone show me where i'm going wrong, i dont want the script writing for me just a simple..'have you thought about doing it this way...' or, 'you fool, this just wont work' kind of thing Cheers Rotahn #### Share this post ##### Link to post ##### Share on other sites think it's case sensitive. Lar. func main() Local$sFile = ".\item.xml"
If FileExists($sFile) Then$ret = _XMLFileOpen ($sFile) if$ret =0 then Exit

$id = _XMLGetValue ("/RealData/ITEM/ID")$desc = _XMLGetValue ("/RealData/ITEM/DESC")
$price = _XMLGetValue ("/RealData/ITEM/PRICE") MsgBox(4096,$desc[0], \$desc[1])
MsgBox(4096, "Error", _XMLError ())
EndIf
EndFunc
Thank you very much Lar..your a star

Even though i feel pretty stupid in the fact that it didn't occur to me to check to see if it was case sensitive

Thanks again

Rotahn

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...