Solved

Invalid xml

Posted on 2013-06-19
2
237 Views
Last Modified: 2013-06-20
In the following VB how do I handle it if there is invalid text when loading the XmlDoc with (text)?
     Dim XmlDoc As New XmlDocument()
     XmlDoc.LoadXml(text)

I don't want ti go to a catch...
I want to set a variable to "Error on file" and then a GoTo
0
Comment
Question by:lrbrister
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39260893
I don't want ti go to a catch...
I'm afraid you'll have to use a Try/Catch. The LoadXml will invoke the internal XML parser, which is what will throw the error. You have no other option than to handle bad XML in the parser. That is, unless you want to download an XML parser that will give you more control over your XML validation.
0
 

Author Comment

by:lrbrister
ID: 39260898
kaufmed,
  That's what I thought. Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question