ChrisL Posted September 2, 2014 Share Posted September 2, 2014 I don't understand why I can't read some XML, the example below shows the problem. _Test() the XML contains xmlns="http://ns.adobe.com/air/framework/update/description/2.5" and will not read the versionNumber _TestNoNameSpace() has the namespace removed and works fine. Anyone know why or how I can get this working please? expandcollapse popup #include "_XMLDomWrapper.au3" MsgBox(0,"",_Test()) MsgBox(0,"",_TestNoNamespace()) Func _Test() Local $Str = '<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5"><versionNumber>7.0.215</versionNumber></update>' _XMLLoadXML($str) $ret = _XMLGetFirstValue("/update/versionNumber") Return $ret EndFunc Func _TestNoNamespace() Local $Str = '<update><versionNumber>7.0.215</versionNumber></update>' _XMLLoadXML($str) $ret = _XMLGetFirstValue("/update/versionNumber") Return $ret EndFunc Func _XMLGetFirstValue($node) Local $ret_val $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Else Return SetError(1,3,0) EndIf EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jdelaney Posted September 2, 2014 Share Posted September 2, 2014 You'd probably have to dig into the UDF function to figure it out, but this works: Local $Str = '<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5"><versionNumber>7.0.215</versionNumber></update>' $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML($Str) $oNode=$oXML.SelectSingleNode('/update/versionNumber') ConsoleWrite($oNode.text & @CRLF) output: 7.0.215 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
ChrisL Posted September 2, 2014 Author Share Posted September 2, 2014 OK, great thanks, I'll try it out [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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