Jud420 Posted October 25, 2007 Share Posted October 25, 2007 (edited) I am trying to use the XML DOM method, and I'm getting an 'invalid xml header' error. What am I doing wrong: Code: #Include <_XMLDomWrapper.au3> _SetDebug() Opt("TrayIconDebug", 1) LoaddXML() Func LoadXML() $sFile = @ScriptDir & "\test.xml" $ret = _XMLFileOpen($sFile) $node = _XMLGetAttrib("/resultset", "count") trace($node) EndFunc Func trace($msg) ConsoleWrite($msg & @CR) EndFunc My XML: <?xml version="1.0" encoding="utf-8" ?> <resultset count="1" fetch-size="1"> <record mod-id="13" record-id="61"> <field name="BRC #"> <data>14003288</data> </field> <field name="criID"> <data>65500071</data> </field> <field name="Client::FirstName"> <data>William</data> </field> <field name="Client::LastName"> <data>Tsombikos</data> </field> <field name="Client::DOB"> <data>11/05/1984</data> </field> </record> </resultset> Edited October 25, 2007 by Jud420 Link to comment Share on other sites More sharing options...
weaponx Posted October 25, 2007 Share Posted October 25, 2007 Is your xml file actually saved as unicode? Link to comment Share on other sites More sharing options...
Jud420 Posted October 26, 2007 Author Share Posted October 26, 2007 autoit wrote it, and the formatting is done by me for readability on the forum. its actually just one long string. What should the header say? Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 26, 2007 Share Posted October 26, 2007 I am trying to use the XML DOM method, and I'm getting an 'invalid xml header' error. What am I doing wrong: Code: #Include <_XMLDomWrapper.au3> _SetDebug() Opt("TrayIconDebug", 1) LoaddXML() Func LoadXML() $sFile = @ScriptDir & "\test.xml" $ret = _XMLFileOpen($sFile) $node = _XMLGetAttrib("/resultset", "count") trace($node) EndFunc Func trace($msg) ConsoleWrite($msg & @CR) EndFunc My XML: <?xml version="1.0" encoding="utf-8" ?> <resultset count="1" fetch-size="1"> <record mod-id="13" record-id="61"> <field name="BRC #"> <data>14003288</data> </field> <field name="criID"> <data>65500071</data> </field> <field name="Client::FirstName"> <data>William</data> </field> <field name="Client::LastName"> <data>Tsombikos</data> </field> <field name="Client::DOB"> <data>11/05/1984</data> </field> </record> </resultset> Other than a typo calling your function LoaddXML(), it works fine for me. I change the attribute to count=123, to be sure it was pulling the right one: >Running:(3.2.8.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Temp\Test.au3" Debug = True Get Attrib length= 1 RET>>123 123 +>10:08:16 AutoIT3.exe ended.rc:0 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now