I have a question / problem with the code below, assuming it seems to work properly, the compiler still warns me about pointers of different types.
Am I doing something wrong? sorry, but i'm not an expert programmer.
Code: Select all
Sub ValidateXMLfromXSD()
Dim As xmlSchemaPtr schema = NULL
Dim As xmlSchemaParserCtxtPtr schema_parser_ctxt = NULL
Dim As Integer has_schema_errors = 0
Dim As Integer ret = -1
Dim As xmlSchemaValidCtxtPtr valid_ctxt = NULL
schema_parser_ctxt = xmlSchemaNewParserCtxt(xsdfile)
If (schema_parser_ctxt <> NULL) Then
schema = xmlSchemaParse(schema_parser_ctxt)
xmlSchemaFreeParserCtxt(schema_parser_ctxt)
If (schema) Then
valid_ctxt = xmlSchemaNewValidCtxt(schema)
EndIf
EndIf
Dim As xmlTextReaderPtr reader = xmlReaderForFile(xmlfile, NULL, 0)
If (reader <> NULL) Then
If (valid_ctxt) Then
xmlTextReaderSchemaValidateCtxt(reader, valid_ctxt, 0)
xmlSchemaSetValidStructuredErrors(valid_ctxt, @schemaParseErrorHandler, @has_schema_errors)
EndIf
ret = xmlTextReaderRead(reader)
Do While (ret = 1)
ret = xmlTextReaderRead(reader)
Loop
EndIf
xmlFreeTextReader(reader)
xmlCleanupParser()
End Sub
Sub schemaParseErrorHandler(byval userData as any ptr, byval merror as xmlErrorPtr)
Static As String test
test += merror->Line & " " & merror->int2 & " " & *merror->message & !"\r\n"
SetDlgItemText(hDlg, IDC_ERROR, StrPtr(test))
End Sub
Code: Select all
warning 3(2): Passing different pointer types, at parameter 2 of XMLSCHEMASETVALIDSTRUCTUREDERRORS()