Validating XML with an XSD file using OLE (OpenInsight 32-bit Specific)
At 11 JAN 2008 12:43:04PM Dale Jessop wrote:
Hi,
Can anyone please tell me where I'm going wrong here? I'm trying to validate an XML file against it's XSD. I've download the files from the MSDN website so know I should receive an error message via the
"parseError.errorCode" command, I've tried this
as
xError=oleGetProperty( objDocument, "parseError")
and
xError=oleGetProperty( objDocument, "parseError.errorCode")
but neither work
XMLFile=c:\dj\xml\sl-notvalid.xml"
XSDFile=c:\dj\xml\sl.xsd"
objDocument=oleCreateInstance( "MSXML2.DOMDocument.6.0" )
gosub checkOLEStatus
olePutProperty( objDocument, "Async", 0 )
gosub checkOLEStatus
olePutProperty( objDocument, "ResolveExternals", 1 )
gosub checkOLEStatus
olePutProperty( objDocument, "ValidateOnParse", 1 )
gosub checkOLEStatus
stat=oleCallMethod( objDocument, "Load", XMLFile )
gosub checkOLEStatus
* Check for errors
*xError=oleGetProperty( objDocument, "parseError.errorCode")
xError=oleGetProperty( objDocument, "parseError")
gosub checkOLEStatus
xmlError=oleGetProperty(xError , "errorCode")
gosub checkOLEStatus
return
*————————–*
checkOLEStatus:
*————————–*
status=OleStatus()
if OleStatus() then
x=msg(@window,'OLE Error code: ':status)
end
return
* XML Source *
sl-valid.xml
Gambardella, Matthew
XML Developer's Guide
Computer
44.95
2000-10-01
An in-depth look at creating applications with
XML.
sl-notvalid.xml
Gambardella, Matthew
XML Developer's Guide
Computer
44.95
2000-10-01
An in-depth look at creating applications with
XML.
sl.xsd
–]