Last post Apr 22, 2008 01:41 AM by Bruno Yu - MSFT
Apr 17, 2008 09:17 AM|nmarc|LINK
I have a code in ASP that goes like:
if CStr(objXML.parseError.errorCode) <> "0" Then
But I need to translate this to VB.NET. What's the equivalence for "parseError.errorCode" in vb.net ??
Apr 22, 2008 01:41 AM|Bruno Yu - MSFT|LINK
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.