Solved

Invalid xml

Posted on 2013-06-19
2
231 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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
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
Comment Utility
kaufmed,
  That's what I thought. Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now