X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=blobdiff_plain;f=xmltooling%2Fbase.h;fp=xmltooling%2Fbase.h;h=b6d3ba3d4eb4579706b50f51d3c56e7abbee32bb;hp=4936a8a3803555c85288e58a89a5d8ba98aec00e;hb=ebb2772c2c65d4fe6f52e7978b9c7f656829614e;hpb=862161ef6283127928bd9307e1a184bf2ea0a6c8 diff --git a/xmltooling/base.h b/xmltooling/base.h index 4936a8a..b6d3ba3 100644 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@ -1354,7 +1354,9 @@ virtual void validate(const xmltooling::XMLObject* xmlObject) const { \ const cname* ptr=dynamic_cast(xmlObject); \ if (!ptr) \ - throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())) + throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())); \ + if (ptr->nil() && (ptr->hasChildren() || ptr->getTextContent())) \ + throw xmltooling::ValidationException("Object has nil property but with children or content.") /** * Begins the declaration of a Schema Validator specialization subclass. @@ -1371,7 +1373,7 @@ virtual void validate(const xmltooling::XMLObject* xmlObject) const { \ const cname* ptr=dynamic_cast(xmlObject); \ if (!ptr) \ - throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())) + throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())); /** * Ends the declaration of a Validator specialization.