locked
ASP: parseError.errorCode RRS feed

  • Question

  • User-1834700287 posted

     Hi,

     I have a code in ASP that goes like:

     

    if CStr(objXML.parseError.errorCode) <> "0" Then

    blablabla

     

    end if

     

    But I need to translate this to VB.NET. What's the equivalence for "parseError.errorCode" in vb.net ??

     

    Tks,

     

    Marcos
     

    Thursday, April 17, 2008 9:17 AM

Answers

  • User-691438185 posted

    nmarc,

    parseError and errorCode property returns an IXMLDOMParseError object that contains information about the last parsing error. In unmanaged VBScript, these functions are easy and commonly used. In .NET development, you can use the related classes and methods in System.Xml namespaces, while the error messages are encapsulate as different kinds of exceptions.

    To validate the XML in the DOM, you can validate the XML as it is loaded into the DOM by passing a schema-validating XmlReader to the Load method of the XmlDocument class, or validate a previously unvalidated XML document in the DOM using the Validate method of the XmlDocument class. There is an example in .NET development, I hope that can help you:

    Validating an XML Document in the DOM

    If you have any further questions, please feel free to reply. Thanks in advance for your posts.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 22, 2008 1:41 AM