Search notes:

VBA: MSXML and DOM - parseError

After loading (and parsing) an XML document, it is advisable to check whether the document is valid. If not, parseError.errorCode has a value different from zero.
option explicit

sub main() ' {

    dim doc as new MSXML2.DOMDocument

    doc.loadXML("<rootElem><closingTagIsMissing>Not a valid XML document!</rootElem>")

    if doc.parseError.errorCode <> 0 then ' {

       debug.print("Error: " & doc.parseError.reason)
     '
     ' Error: End tag 'rootElem' does not match the start tag 'closingTagIsMissing'.
     '

    end if ' }

end sub ' }
Github repository about-VBA, path: /object-libraries/MSXML/DOM/parseError.bas

See also

MSXML and DOM

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759407105, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/Useful-object-libraries/MSXML/DOM/parseError(58): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78