Solved

Invalid xml

Posted on 2013-06-19
2
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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 this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

623 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