[xml] Validating In Memory (How to get a ValidCtxtPointer?)




Hello,

I've searched up and down for a answer to this question and have come to
nothing so here it goes :)

I have the following C++ code:


Result XMLDocument::isValid(CmtString const& dtdFullPathName,
                            bool& isValid)
{
  // get the dtd's name and parse the dtd.
  xmlDtdPtr dtd = xmlParseDTD(NULL, BAD_CAST dtdFullPathName.getData());

   isValid = false;
   if ( dtd == NULL)
   {
      return Result(CMT_FAILURE);
   }

   // build a xmlValidCtxt Ptr 
 *************** This is the problem *****************
// docPtr is an xmlDocumentPtr 

   xmlValidCtxtPtr ctxt = xmlValidNewContext (data_->docPtr_);
*********************************************

   // check validity.
   if ( xmlValidateDtd(ctxt,data_->docPtr_,dtd))
   {
      isValid = true;
   }

   xmlFreeDtd(dtd);

*************** This is probably also a problem ***************
   xmlValidFreeContext(ctxt);
**********************************************************
   return Result(CMT_SUCCESS);

}


The main problem here is that I don't know how to get a hold of a proper
xmlValidContextPtr. I'm sure someone out there knows :) 

Help,please?

Thank you in advance, 

-- 
Craig

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]