INT
_grammar
,
_doc
BOOL
_bFree
_grammar
:=
%XML_Load_XSD_Grammar
(
_FILE_XSD
,
""
)
IF
_grammar
\VLD =
@FALSE
|
_grammar
=
0
THEN
_sError
:=
"%XSD definition cannot be loaded!"
+
%XML_GetLastErrorMessage
()
RETURN
ENDIF
_doc
:=
%XML_OpenDocument
(
_FILE_XML
,
@FALSE
,
""
,
@FALSE
)
IF
_doc
\VLD =
@FALSE
|
_doc
=
0
THEN
_sError
:=
"%XML Document cannot be opened! "
+
%XML_GetLastErrorMessage
()
_bFree
:=
%XML_FreeGrammar
(
_grammar
)
RETURN
ENDIF
BOOL
_bIsValid
_bIsValid
:=
%XML_Validate_XSD
(
_grammar
,
_doc
)
_bFree
:=
%XML_FreeGrammar
(
_grammar
)
_bFree
:=
%XML_FreeDocument
(
_doc
)
IF
_bIsValid
\VLD =
@FALSE
|
_bIsValid
=
@FALSE
THEN
_sError
:=
"%XML_Validate_XSD doesn't work correctly!"
+
%XML_GetLastErrorMessage
()
RETURN
ENDIF
Pridať komentár