Jump to content

Recommended Posts

Posted

I would be grateful for the constructive comments ;)
mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
Posted (edited)
  On 9/3/2015 at 6:25 AM, supersonic said:

mLipok,

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

Thanks

 

  On 9/3/2015 at 6:25 AM, supersonic said:

- 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

 

  On 9/3/2015 at 6:25 AM, supersonic said:

- 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 Best coding practices)
  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 .

 

  On 9/3/2015 at 6:25 AM, supersonic said:

Maybe I could help.

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

 

  On 9/3/2015 at 6:25 AM, supersonic said:

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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

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...!?

 

Posted
  On 9/3/2015 at 8:35 AM, supersonic said:

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!

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted
  On 9/3/2015 at 10:46 AM, guinness said:

As the current UDF isn't ready for submission!

I know.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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.)

I know that I can read about it here.

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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I corrected this following list:

  On 9/3/2015 at 7:23 AM, mLipok said:

But we have many TODO 

  1. finish entire UDF rewrite (according to UDF-spec and Best coding practices)
  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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

new version:

  Quote

    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_ArrayAdd >> _XML_Array_AddName - 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

 

Download link. 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

new version:

  Quote

    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)

 

 

Download link. 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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.


What you mean about:

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

??

any comments are welcome

Edited by mLipok
wording

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Little off topic story ;)

  Reveal hidden contents

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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

 

  On 9/3/2015 at 6:25 AM, supersonic said:

Maybe I could help.

Where to start?

  On 9/3/2015 at 8:35 AM, supersonic said:

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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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"

_Tasks_XML()
Func _Tasks_XML()
    _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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

From the current work:

  Quote

    . Removed: almost all MsgBox() - leaves only in __XML_Misc_MsgBoxNotifier()
    . Changed: in Examples : Global $oErrorHandler >> Local $oErrorHandler

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

 

  On 9/7/2015 at 3:46 AM, guinness said:

Also documentation doesn't quite match some of the function signatures.

I know.

You can read in UDF header

  Quote

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:

  Quote

@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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

new version:

  Quote

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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...