[xml] problem in validation with SAX
- From: "uttam rao" <auttamrao hotmail com>
- To: xml gnome org
- Subject: [xml] problem in validation with SAX
- Date: Thu, 08 Aug 2002 12:19:52 +0000
Hello Daniel,
I am using sax interface of libxml to validate an xml file.
just for information xml file and the dtd files are valid and well formed.
I am able to acheive this by DOM implementation but in the following
approach it fails.
Please see the commented line in the following code
- - - - - - - - -
xmlParserCtxtPtr ctxt = NULL;
static xmlSAXHandler hndSax;
// appropriate handlers are assigned to hndSax
ctxt= xmlCreateFileParserCtxt("test.xml");
ctxt->validate = 1;
//if I enable the following command,it does not check for validation
//against a dtd file.
//ctxt->sax= &hndSax;
xmlParseDocument(ctxt);
if( ctxt->valid )
{
// it always says valid if I enable the above mentioned command.
printf("\ndocument is valid\n");
}
- - - - - - - - -
gruß
Uttam
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]