Validating the Instance Document
To validate the simple type data in an instance document you can use the
isValid() method. The basic
isValid() method returns a
bool value indicating whether all checks of simple type data in the document affirmed that the data was valid. To determine the exact nature of the errors in the event that
isValid() returns
false, you need to use the overload that passes in an
rwsf::XmlValidator instance. The code below shows how you would check the errors for the
PurchaseOrder instance.
rwsf::XmlValidator validator("temp");
if (!po.isValid(validator)) {
std::list<rwsf::XmlSchemaException> errs = validator.getErrors();
list::iterator iter = errs.begin();
while(iter != errs.end()) {
std::cout << (*iter).what() << std::endl;
}
}