# XML.au3 - BETA - Support Topic

## 157 posts in this topic

#1 ·  Posted (edited)

I was asking @eltorro serveral times for any support  for XML DOM wrapper (COM) - with no success

So I took matters into my hands .....

I want to present XMLWrapperEx.au3 - BETA Version

Want to join to the project ?

Here is some description:

; #INDEX# =======================================================================================================================
; Title .........: XMLWrapperEx.au3
; AutoIt Version : 3.3.10.2++
; Language ......: English
; Description ...: Functions to use for reading and writing XML using msxml.
; Remarks .......: BETA Version
; Author ........: mLipok
; Version .......: "1.1.1.01" ; _XML_MiscProperty_UDFVersion()

#cs
This UDF is created on the basis of:
https://www.autoitscript.com/forum/topic/19848-xml-dom-wrapper-com/
For this reason, I attach also the last known (to me) previous version ($_XMLUDFVER = "1.0.3.98" _XMLDomWrapper_1.0.3.98_CN.au3 ) For the same reason I continue to recognize the achievements of the work of my predecessors (they are still noted in each Function header). . . . . !!!!!!!!! This is BETA VERSION (all could be changed) !!!!!!!!! . . . WORK IN PROGRES INFORMATION: For now 2015-09-01 the descripion (Function Header) can not entirely correctly describe the function. TODO: in many places I used "TODO" as a keyword to find what should be done in future . I want to: PREVENT THIS: The unfortunate nature of both the scripts is that the func return results are strings or arrays instead of objects. . I want to: USE THIS CONCEPT: . All function should use Refernce to the object as first Function parameter . All function should return in most cases objects. There should be separate functions to Change Object collection to array . All function should use COM Error Handler in local scope. . All function should return @error which are defined in #Region XMLWrapperEx.au3 - @ERROR Enums . All function should have the same naming convention . All variables should have the same naming convention . There should not to be any Global Variable - exception is$g__oXMLDOM_Events
.   It should be possible easy to use XML DOM Events
.        https://msdn.microsoft.com/en-us/library/ms764697(v=vs.85).aspx
.   It should be possible easy to Debug
.    Ultimately, you should be able to do anything with your XML without having to use your own Error Handler.

#CE

REMARK:
This UDF was formerly named:   XMLWrapperEx.au3

Edited by mLipok
1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

I would be grateful for the constructive comments
mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#3 ·  Posted (edited)

mLipok,

greate idea to start a re-write of this widely-used UDF! :-)

Following points came up to my mind to improve (or keep the state of) this UDF:

- x86/x64 Support (currently working)
- A much better error handling by providing error return codes all over - and their documentation. Perhaps removing '_XMLError()'!?
- Clear code structure, no code blow up (= removing old/useless comments, implementing current AutoIt coding capabilities, consistent variable names, etc.)
- This UDF - presuming a successful re-write - has the potential to be part of the AutoIt built-in UDFs in the future!? Therefore the quality of the UDF has to meet *any* requirements defined by the AutoIt-Devs.

Maybe I could help.

Where to start?

Edited by supersonic

##### Share on other sites

#4 ·  Posted (edited)

mLipok,

greate idea to start a re-write of this widely-used UDF! :-)

Thanks

- x86/x64 Support (currently working)
- A much better error handling by providing error return codes all over - and their documentation. Perhaps removing '_XMLError()'!?
- Clear code structure, no code blow up (= removing old/useless comments, implementing current AutoIt coding capabilities, consistent variable names, etc.)

work In progress - look in my UDF and say exactly what is not done already

- This UDF - presuming a successful re-write - has the potential to be part of the AutoIt build-in UDFs in the future!? Therefore the quality of the UDF has to meet *any* requirements defined by the AutoIt-Devs.

I hope that. We must ask dev team.

But we have many TODO

1. finish entire UDF rewrite (according to UDF-spec and
2. make EXAMPLES
3. get feedback from community
4. debuging
5. ask "Dev Team" is it OK ?
6. make TXT files for HelpFile
7. ask "Dev Team" is it OK ?
8. post it to "Dev Team"
9. wait for AutoIt release

I hope that nothing is missed in my TODO List .

Maybe I could help.

I hope you want, this is first step.
Do it - this is second step

Where to start?

Right here where you read this topic. (Well, unless your question was of a different nature.)

Best regards,

mLipok

Edited by mLipok
typo, wording, UDF TODO List rewrite.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

This could be a bit larger project - so "Where to start?" means that any work should be organized/coordinated in some way...

To have any chance this UDF to become an AutoIt built-in UDF the AutoIt devs should be asked before start coding...!?

##### Share on other sites

AutoIt devs should be asked before start coding...!?

Not really, because even if we say no, that shouldn't stop anyone from re-writing and posting in the examples section. Having it included as an official UDF is basically peace of mind for some people, though honestly whether it's in AutoIt or examples section, these days doesn't really matter.

But please continue to re-write. If the code is structured well enough and all "checkboxes" for submission are checked, then I might be convinced to spend some time adding to the UDFs. Though again I make no guarantees that it will be included and will have to be impressed. As the current UDF isn't ready for submission!

1 person likes this

##### Share on other sites

As the current UDF isn't ready for submission!

I know.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#8 ·  Posted (edited)

Can you enumerate what at the moment is inconsistent with the standard for the UDF (Maybe not necessarily now, because I know that is a lot of room for improvement.)

But unfortunately still my language skills are sometimes a problem for me.
Therefore, the above specification often seems to me that is not clear.
Much less clear if analyzed the current standard UDF, which I understand they were created prior to this specification.

btw.
I guess I finally open a new thread with questions about the current specification for the UDF (as I had planned).
A separate thread will be a good solution that does not "messes up" the thread in which I'm writing now.

EDIT:

for reference only:

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

I corrected this following list:

But we have many TODO

1. finish entire UDF rewrite (according to UDF-spec and
2. make EXAMPLES
3. get feedback from community
4. debuging
5. ask "Dev Team" is it OK ?
6. make TXT files for HelpFile
7. ask "Dev Team" is it OK ?
8. post it to "Dev Team"
9. wait for AutoIt release

I hope that nothing is missed in my TODO List .

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#10 ·  Posted (edited)

new version:

2015/09/04
"1.1.1.02"

. event handler renamed to $__g_oXMLDOM_EventsHandler - mLipok . added$__g_eXML_ERROR_Save_FileIsRO and checking in - mLipok
. if variable is ObjectsCollection then variable name ends with sufix "Coll" - mLipok
. variable used in loops are named with sufix "_idx" like this For $iAttribute_idx = 0 To$oAttributesColl.length - 1 - mLipok
. variable used in loops are named with sufix "Enum" like this For $oNodeEnum in$oNodesColl - mLipok
. Local Variable renaming: $strQuery >$sQuery - mLipok - thanks to guinness
. Local Variable renaming: $sComment >$sComment - mLipok - thanks to guinness
. Function renamed fixed typo in function name _XML_createAttributeute => _XML_CreateAttribute - mLipok - thanks to guinness
. Function renamed _XML_Misc_NodesList_GetNames >> _XML_Array_GetNodesNamesFromCollection - mLipok
. Global Enum renamed from   $g__eXML_..... to$__g_eXML_..... - mLipok
. Function renamed _XML_Misc_NodesColl_GetNamesToArray >> _XML_Array_GetNodesNamesFromCollection - mLipok
. Function renamed _XML_DeleteNode_XML_DeleteNode >> _XML_removeAll - mLipok
. Function renamed _XML_FileOpen >> _XML_Load - mLipok
. new Function _XML_Array_GetNodeList() - mLipok
. UDF FileName: _XMLDOMWrapperEx.au3 >> XMLWrapperEx.au3 - mLipok
. !!! EXAMPLES FILE:    XMLWrapperEx__Examples.au3 - mLipok

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#11 ·  Posted (edited)

new version:

2015/09/06
"1.1.1.03"
. Renamed Function: _XMLCreateChildWAttr >> _XML_CreateChildWAttr - mLipok
. Renamed ENUMs:  $__g_eXML_ERROR... >>$XMLWRAPPER_ERROR... - mLipok - Thanks to guinness
. Renamed ENUMs:  $__g_eXML_RESULT... >>$XMLWRAPPER_RESULT... - mLipok - Thanks to guinness
. Renamed CONST:  $XMLDOM_DOCUMENT_READYSTATE_... >>$XMLWRAPPER_DOCUMENT_READYSTATE_... - mLipok - Thanks to guinness
. Renamed Variable : $oXML_Document >>$oXmlDoc  - for shortness, and compliance with examples of MSDN - mLipok
. New Example: _Example_2__XML_CreateChildWAttr - mLipok
. New Example: _Example_3__XML_Misc_ErrorDecription - mLipok
. New Example: _Example_MSDN_1__setAttributeNode - mLipok
. New Function: _XML_Misc_Viewer - mLipok
. New: Function: _XML_Misc_ErrorParser() -- added as a replacment for using _XML_Misc_ErrorDecription() - mLipok
. NEW: @ERROR result: $XMLWRAPPER_ERROR_ARRAY - mLipok . NEW: @ERROR result:$XMLWRAPPER_ERROR_NODECREATEAPPEND - mLipok
. Removed: all old _XML_Misc_ErrorDecription() - mLipok
. Removed: _XML_Misc_ErrorDecription_Reset()- mLipok
. Removed: all $sXML_error - mLipok . Removed: _XML_Error_Reason - mLipok . COMPLETED: @error checking for .selectNodes methods: @error is set to:$XMLWRAPPER_ERROR_XPATH - mLipok
. COMPLETED: _XML_CreateChildWAttr - mLipok
. COMPLETED: Standardarization for using Return Value @error codes returned from function --> ENUMERATED CONSTATNS - mLipok
.         Now all functions  Return like the following examples:
.                Return SetError($XMLWRAPPER_ERROR_......... . or in this way: . If @error Then Return SetError(@error, @extended,$XMLWRAPPER_RESULT_FAILURE)

Edited by mLipok
1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#12 ·  Posted (edited)

Hey community, this is "AutoIt Projects and Collaboration" so I need some feedback.
Do not be shy, get involved.

So I ask you, even if you're among us shortly.

1. _Example_3__XML_Misc_ErrorDecription
2. the way I use Error Handler in local scope

??

Edited by mLipok
wording

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

Little off topic story

Maybe you're wondering why I got involved in running such a large project.

The answer is simple: I just wanted to learn XML technology.

Over a year ago I read the various threads on this forum, I started using XMLDomWrapper.au3, but quickly found that has a lot of problems and errors. I was disheartened so my learning XML was pushed into the background.

After some time, I was bored, so I looked at the cabinet with unread books. The choice fell on "XML seriously." - (Polish book of 2002).  Even though it's old, I started reading, and a little knowledge became for me to understand.

A month ago I returned to XMLDomWrapper.au3, and I started to analyze any problem with XML, which was discussed at that time in the forum.
At the same time non-stop, still I peek at MSDN.

At a time when "AutoIt Projects and Collaboration" was created, I knew that ultimately here this story will have its future course. But to move from the place it was necessary to give the course. So I started continue to analyze XMLDomWrapper.au3, and at the same time I started to change it.

So we are here and now.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

Maybe I could help.

Where to start?

This could be a bit larger project - so "Where to start?" means that any work should be organized/coordinated in some way...

I hope you get involved, even through testing and comments, it would be good if you gave it some concepts, or just added some of your code.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

##### Share on other sites

#15 ·  Posted (edited)

member @DarkAqua asked for help here:

and was redirected by @KingBob here.

The question was intresting for me so I make this exmaple:

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7
#Tidy_Parameters=/sort_funcs /reel

#include <array.au3>
#include <date.au3>
#include "XMLWrapperEx.au3"

_XML_MiscProperty_NotifyAll(True)
_XML_MiscProperty_NotifyToMsgBox(False)

Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc_CustomUserHandler") #forceref$oErrorHandler

; Add user ComError handler ; it will be used toogether with internal ComError handler
_XML_ComErrorHandler_UserFunction(_ErrFunc_CustomUserHandler)

Local $sXmlFile = @ScriptDir & "\_test\tasks.xml" Local$oXmlDoc = _XML_CreateObject()
_XML_Load($oXmlDoc ,$sXmlFile)
; MsgBox($MB_SYSTEMMODAL +$MB_ICONINFORMATION, 'tasks.xml', _XML_TIDY($oXmlDoc)) Local$oNodesColl = _XML_SelectNodes($oXmlDoc, "//Task") Local$aTaskList[0][2]
Local $iPrevUbound = UBound($aTaskList)
For $oNodeEnum In$oNodesColl
$iPrevUbound = UBound($aTaskList)
ReDim $aTaskList[$iPrevUbound +1][2]
$aTaskList[$iPrevUbound][0] = $oNodeEnum.selectSingleNode('MangaName').text$aTaskList[$iPrevUbound][1] =$oNodeEnum.selectSingleNode('Website').text
Next

_ArrayDisplay($aTaskList, '$aTaskList')

EndFunc   ;==>_Example_1__XML_SelectNodes

Func _ErrFunc_CustomUserHandler($oError) ConsoleWrite(@ScriptName & " (" &$oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
@TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB &$oError.windescription & @CRLF & _
@TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB &$oError.source & @CRLF & _
@TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB &$oError.helpcontext & @CRLF & _
@TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB &$oError.scriptline & @CRLF & _
@TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc_CustomUserHandler Edited by mLipok Script changed to met current UDF stage Signature beginning: Wondering who uses AutoIT and what it can be used for ? * GHAPI UDF - modest begining - comunication with GitHub REST API * How to use IE.au3 UDF with AutoIt v3.3.14.x for other useful stuff click the following button Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF * "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer "Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2017-06-04 #### Share this post ##### Link to post ##### Share on other sites #16 · Posted (edited) Global used inside a function? Come @mLipok, you should know better than that. Change to Local and you should be good. Edit: Also I noticed this comment "; TODO Magic Number Remove", but message boxes shouldn't be in UDFs like this. Also documentation doesn't quite match some of the function signatures. Edited by guinness #### Share this post ##### Link to post ##### Share on other sites From the current work: . Removed: almost all MsgBox() - leaves only in __XML_Misc_MsgBoxNotifier() . Changed: in Examples : Global$oErrorHandler >> Local $oErrorHandler Signature beginning: Wondering who uses AutoIT and what it can be used for ? * GHAPI UDF - modest begining - comunication with GitHub REST API * How to use IE.au3 UDF with AutoIt v3.3.14.x for other useful stuff click the following button Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF * "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer "Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2017-06-04 #### Share this post ##### Link to post ##### Share on other sites Also documentation doesn't quite match some of the function signatures. I know. You can read in UDF header WORK IN PROGRES INFORMATION: For now 2015-09-01 the descripion (Function Header) can not entirely correctly describe the function. As you see this is known issue, and to fix this it should take some time, as I going step by step. For this I made a Keyword system for checking: @DONE - this keyword is usefull for bookmark finished functions And I add many TODO keyword for remember. Regardless of this, big thanks for reminder. Signature beginning: Wondering who uses AutoIT and what it can be used for ? * GHAPI UDF - modest begining - comunication with GitHub REST API * How to use IE.au3 UDF with AutoIt v3.3.14.x for other useful stuff click the following button Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF * "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer "Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2017-06-04 #### Share this post ##### Link to post ##### Share on other sites I temporary add to the UDF new region: #Region XMLWrapperEx.au3 - TOOLs OFF LINE XPath Tools http://qutoric.com/xmlquire/ https://xpathvisualizer.codeplex.com/ I was checking today this tools, and I can say they are usefull. Signature beginning: Wondering who uses AutoIT and what it can be used for ? * GHAPI UDF - modest begining - comunication with GitHub REST API * How to use IE.au3 UDF with AutoIt v3.3.14.x for other useful stuff click the following button Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF * "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer "Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2017-06-04 #### Share this post ##### Link to post ##### Share on other sites #20 · Posted (edited) new version: 2015/09/07 "1.1.1.04" . Renamed:$iXMLWrapper_Error_number >> $iXMLWrapper_Error - mLipok . Removed: almost all MsgBox() - leaves only in __XML_Misc_MsgBoxNotifier() - mLipok . Changed: in Examples : Global$oErrorHandler >> Local $oErrorHandler - mLipok . Renamed _XML_Array_GetNodeList >> _XML_Array_GetNodesProperties - mLipok . Removed: _XML_Array_GetNodesFromCollection as this was duplicate for _XML_Array_GetNodesProperties - mLipok . NEW:$eNodeList_attributes in function _XML_Array_GetNodesProperties - now also display all atributes - mLipok
. Renamed: _XML_MiscProperty_DomVersion >> __XML_MiscProperty_DomVersion - as this should be internal - as you can use _XML_Misc_GetDomVersion() - mLipok
. Renamed: _XML_ComErrorHandler_MainFunction >> __XML_ComErrorHandler_MainFunction - as this should be internal - mLipok
. Renamed: _XML_ErrorParser >> _XML_ErrorParser_GetDescription - mLipok
. Removed: _XML_Misc_ErrorParser - will be in Examples - mLipok
. Changed: Return value behavior - mLipok
.    From:
.        SetError($XMLWRAPPER_ERROR_PARSE,$oXmlDoc.parseError.errorCode, $oXmlDoc.parseError.reason) . SetError($XMLWRAPPER_ERROR_PARSE, $oXmlDoc.parseError.errorCode,$XMLWRAPPER_RESULT_FAILURE)
. Changed: _XML_Load and _XML_LoadXML require $oXmlDoc as first parameter, you must use _XML_CreateObject() as only in this way it is possible to use _XML_ErrorParser_GetDescription() - mLipok . All examples changed to show how to use "new" _XML_Load and _XML_LoadXML . NEW: ENUMs:$XMLWRAPPER_ERROR_EMPTYCOLLECTION - mLipok
. NEW: ENUMs: $XMLWRAPPER_ERROR_NONODESMATCH - mLipok . Changed: MAGIC NUMBERS: for StringStripWS in _XML_DeleteNode() - mLipok . COMPLETED: _XML_NodeExists - mLipok . COMPLETED: Refactroing all functions with "selectNodes" Method now have checking: If$oNodesColl.length = 0 Then ... SetError($XMLWRAPPER_ERROR_EMPTYCOLLECTION ..... - mLipok . COMPLETED: Refactroing all functions with "selectSingleNode" Method now have checking: If$oNode_Selected = Null Then .. SetError($XMLWRAPPER_ERROR_NONODESMATCH..... - mLipok Edited by mLipok Download link. Signature beginning: Wondering who uses AutoIT and what it can be used for ? * GHAPI UDF - modest begining - comunication with GitHub REST API * How to use IE.au3 UDF with AutoIt v3.3.14.x for other useful stuff click the following button Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 - BETA * SMTP Mailer UDF * "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer "Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2017-06-04 #### Share this post ##### Link to post ##### Share on other sites ## 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 account ## Sign in Already have an account? Sign in here. Sign In Now • ### Similar Content • By Simpel Hi. I'm trying to write a xml. Here is my code: #include <_XMLDomWrapper.au3> #include <Date.au3> Global$g_sXMLFileName Global $g_sDestPath = @DesktopDir & "\" Global$g_sReturnedBID = "A10829" _makeXML() _AddXML(1, "A10829_Thomas/wav/T001.wav") _AddXML(2, "A10829_Thomas/wav/T002.wav") Exit Func _makeXML() Local $sXMLtime = StringReplace(StringReplace(StringReplace(_NowCalc()," ","_"),":","-"),"/","-") ; in yyyy-mm-dd_hh-mm-ss$g_sXMLFileName = $g_sDestPath &$g_sReturnedBID & "_" & "EB-Ton-Upload" & "_" & $sXMLtime & ".xml" _XMLCreateFile($g_sXMLFileName, "gemagvl", 1,1) _XMLFileOpen($g_sXMLFileName) EndFunc Func _AddXML($iCount, $sDateiname) _XMLCreateRootNodeWAttr("row", "count",$iCount, "") _XMLCreateChildNode("//row", "picklistenname", $g_sReturnedBID & "_EB-Ton-Upload") _XMLCreateChildNode("//row", "picklisteninfo") _XMLCreateChildNode("//row", "bid",$g_sReturnedBID) _XMLCreateChildNode("//row", "audiodateiname", $sDateiname) _XMLCreateChildNode("//row", "titel", StringTrimRight(StringTrimLeft($sDateiname, 7), 4)) _XMLCreateChildNode("//row", "interpret", "EB") _XMLCreateChildNode("//row", "quelle", "Ton") EndFunc It returns:
<?xml version="1.0" encoding="UTF-8"?><gemagvl> <row count="1"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T001.wav</audiodateiname> <titel>Thomas/wav/T002</titel> <interpret>EB</interpret> <quelle>Ton</quelle> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> <row count="2"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> </gemagvl> But it should return:
<?xml version="1.0" encoding="UTF-8"?><gemagvl> <row count="1"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T001.wav</audiodateiname> <titel>Thomas/wav/T002</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> <row count="2"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> </gemagvl> The second inserted nodes are double. How will it be going right?
• By rootx
I need help to read in a loop the DVD id child and subchild. Thx
Example...
DVD001 - PAL - EN,FR,DE,ES,IT and filter the right title & descri language.  I tried with $oXML.SelectSingleNode but without success <?xml version="1.0" encoding="UTF-8"?> <datafile xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mydvd.xsd"> <dvd name="My dvd title"> <id>DVD001</id> <region>PAL</region> <languages>EN,FR,DE,ES,IT</languages> <locale lang="EN"> <title>title en</title> <descri>descri en</descri> </locale> <locale lang="FR"> <title>title fr</title> <descri>descri fr </descri> </locale> <locale lang="DE"> <title>title de</title> <descri>descri de </descri> </locale> <locale lang="ES"> <title>title es</title> <descri>descri es</descri> </locale> <locale lang="IT"> <title>title it</title> <descri>descri it</descri> </locale> </dvd> <dvd name="My dvd title 2"> <id>DVD002</id> <region>USA</region> <languages>EN</languages> <locale lang="EN"> <title>title en</title> <descri>descri en</descri> </locale> </dvd> </datafile> #include <File.au3>$xml = @ScriptDir&"\test.xml" Local $oXML = ObjCreate("Microsoft.XMLDOM")$oXML.load($xml)$id = $oXML.SelectNodes("//dvd") For$ids In $id ConsoleWrite($ids.text &@CRLF) Next
• By 31290
Hi Guys,
Since I'm able to get a Dell equipment warranty status thanks to my API key, I'm using an UDF to extract data from an XML file and get the end date. >
Thing is, when using InetGet, the original file is in JSON format and the UDF is not working anymore, even if I download the file with the xml extension. Therefore, and when I manually download the page with Chrome, I have a proper XML file where the UDF is working fine.
Here's my code:
I even tried to convert the json to xml > https://www.autoitscript.com/forum/topic/185717-js-json-to-xml/
I took a look here https://www.autoitscript.com/forum/topic/104150-json-udf-library-fully-rfc4627-compliant/ but I don't understand anything :/

The XML read UDF is just perfect for my needs but I'm stuck here...
-31290-
3MTXM12.json
3MTXM12.xml
• By Zaroz
Alright, this is going to be a rather long explanation so bear with me.
What I am trying to to is build a GUI program that, in the end, will look like this:
The middle Frame is for displaying a desktop icon and the right frame is for displaying a selected image.
The XML file I am using looks like this:
<list> <item id="1"> <ico>Path\to\icon1<\ico> <img>Path\to\image1<\img> <exe>Path\to\program1<\exe> <label>UserDefinedLabel1<\label> <\item> <item id="2"> <ico>Path\to\icon2<\ico> <img>Path\to\image2<\img> <exe>Path\to\program2<\exe> <label>UserDefinedLabel2<\label> <\item> <\list> What I want this program to do is when I highlight an item in the listbox (which btw is displaying the <label> value associated with the item) I want the displayed icon and image to change to the ones associated with that entry.
Also I would like to include an additional dialog to open when the 'ADD' button is clicked that will add entries to the XML file that looks like this:

The main problem I am running into is that I do not know much about XML and how to parse it into dynamic variables that can change based off of selection.
Any help is appreciated.

10-29-16 EDIT: For all intents and purposes, I basically want to create something similar to PStart, but with a preview pane with a customizable image for each item in it.
• By ur
Any internal xml API to parse and edit XML files in AutoIT?