Isn't the xmlException bugged ?

For me (RB2006R3) it still chrashes on some invalid xml docs like
incomplete docs

Greetings Dave

On 8/20/06, Mark Nutter <[EMAIL PROTECTED]> wrote:


--- [EMAIL PROTECTED] wrote:

> I feel like I'm missing something simple here, but I'm having
> trouble
> getting anywhere.  How do you load an XML document that could
> potentially have errors in it like mismatched tags without
> throwing
> up errors?  Do I need a formal error handler in order to
> prevent my
> app from quitting after opening an XML document with an error
> in it?

Yes, put your LoadXML call inside a Try/Catch block:

Dim xdoc as XmlDocument
Dim node as XMLNode
Dim i, count as Integer
Dim out as String

  // create a new document
xdoc = New XmlDocument

xdoc.PreserveWhitespace = False

try
  // load and parse the xml in the EditField, parse_InputText
  xdoc.LoadXml(parse_inputText.Text)
catch xe As XMLException
  MsgBox "Error reading XML data: " + xe.Message
end try

That should at least keep your app from crashing on an invalid
XML doc.



Mark Nutter

Quick and easy regex creation and debugging!
http://www.bucktailsoftware.com/products/regexplorer/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to