[xml] problem in validation with SAX

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;


 if( ctxt->valid )
// it always says valid if I enable the above mentioned command.

printf("\ndocument is valid\n");
- - - - - - - - -


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]