Multi-line svn commit, see body.
[shibboleth/cpp-xmltooling.git] / xmltooling / base.h
index 3375844..106816f 100644 (file)
  */
 #define BEGIN_XMLOBJECT(linkage,cname,base,desc) \
     XMLTOOLING_DOXYGEN(desc) \
-    class linkage cname : public virtual base, public virtual xmltooling::ValidatingXMLObject { \
+    class linkage cname : public virtual base { \
     protected: \
         cname() {} \
     public: \
  */
 #define BEGIN_XMLOBJECT2(linkage,cname,base,base2,desc) \
     XMLTOOLING_DOXYGEN(desc) \
-    class linkage cname : public virtual base, public virtual base2, public virtual xmltooling::ValidatingXMLObject { \
+    class linkage cname : public virtual base, public virtual base2 { \
+    protected: \
+        cname() {} \
+    public: \
+        virtual ~cname() {} \
+        XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+        virtual cname* clone##cname() const=0; \
+        XMLTOOLING_DOXYGEN(Element local name) \
+        static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with three base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ * 
+ * @param linkage   linkage specifier for the class
+ * @param cname     the name of the class to declare
+ * @param base      the first base class to derive from using public virtual inheritance
+ * @param base2     the second base class to derive from using public virtual inheritance
+ * @param base3     the third base class to derive from using public virtual inheritance
+ * @param desc      documentation comment for class
+ */
+#define BEGIN_XMLOBJECT3(linkage,cname,base,base2,base3,desc) \
+    XMLTOOLING_DOXYGEN(desc) \
+    class linkage cname : public virtual base, public virtual base2, public virtual base3 { \
+    protected: \
+        cname() {} \
+    public: \
+        virtual ~cname() {} \
+        XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+        virtual cname* clone##cname() const=0; \
+        XMLTOOLING_DOXYGEN(Element local name) \
+        static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with four base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ * 
+ * @param linkage   linkage specifier for the class
+ * @param cname     the name of the class to declare
+ * @param base      the first base class to derive from using public virtual inheritance
+ * @param base2     the second base class to derive from using public virtual inheritance
+ * @param base3     the third base class to derive from using public virtual inheritance
+ * @param base4     the fourth base class to derive from using public virtual inheritance
+ * @param desc      documentation comment for class
+ */
+#define BEGIN_XMLOBJECT4(linkage,cname,base,base2,base3,base4,desc) \
+    XMLTOOLING_DOXYGEN(desc) \
+    class linkage cname : public virtual base, public virtual base2, public virtual base3, public virtual base4 { \
     protected: \
         cname() {} \
     public: \
  */
 #define DECL_DATETIME_ATTRIB(proper,upcased) \
     DECL_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
+    XMLTOOLING_DOXYGEN(Returns the proper attribute in epoch form.) \
+    virtual time_t get##proper##Epoch() const=0; \
     XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
     virtual void set##proper(time_t proper)=0; \
     XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
     public: \
         XMLTOOLING_DOXYGEN(proper attribute name) \
         static const XMLCh upcased##_ATTRIB_NAME[]; \
-        XMLTOOLING_DOXYGEN(Returns the proper attribute.) \
-        virtual int get##proper() const=0; \
+        XMLTOOLING_DOXYGEN(Returns the proper attribute after a NULL indicator.) \
+        virtual std::pair<bool,int> get##proper() const=0; \
+        XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
+        virtual void set##proper(const XMLCh* proper)=0; \
         XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
         virtual void set##proper(int proper)=0
 
  * 
  * @param proper    the proper name of the attribute
  * @param upcased   the upcased name of the attribute
+ * @param def       the default/presumed value, if no explicit value has been set
  */
-#define DECL_BOOLEAN_ATTRIB(proper,upcased) \
+#define DECL_BOOLEAN_ATTRIB(proper,upcased,def) \
     public: \
         XMLTOOLING_DOXYGEN(proper attribute name) \
         static const XMLCh upcased##_ATTRIB_NAME[]; \
-        XMLTOOLING_DOXYGEN(Returns the proper attribute.) \
-        virtual bool proper() const=0; \
+        XMLTOOLING_DOXYGEN(Returns the proper attribute or def if not set.) \
+        bool proper() const { \
+            switch (get##proper()) { \
+                case xmltooling::XMLConstants::XML_BOOL_TRUE: \
+                case xmltooling::XMLConstants::XML_BOOL_ONE: \
+                    return true; \
+                case xmltooling::XMLConstants::XML_BOOL_FALSE: \
+                case xmltooling::XMLConstants::XML_BOOL_ZERO: \
+                    return false; \
+                default: \
+                    return def; \
+            } \
+        } \
+        XMLTOOLING_DOXYGEN(Returns the proper attribute as an explicit enumerated value.) \
+        virtual xmltooling::XMLConstants::xmltooling_bool_t get##proper() const=0; \
+        XMLTOOLING_DOXYGEN(Sets the proper attribute using an enumerated value.) \
+        virtual void proper(xmltooling::XMLConstants::xmltooling_bool_t value)=0; \
         XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
-        virtual void proper(bool value)=0
+        void proper(bool value) { \
+            proper(value ? xmltooling::XMLConstants::XML_BOOL_ONE : xmltooling::XMLConstants::XML_BOOL_ZERO); \
+        } \
+        XMLTOOLING_DOXYGEN(Sets the proper attribute using a string constant.) \
+        void set##proper(const XMLCh* value) { \
+            if (value) { \
+                switch (*value) { \
+                    case chLatin_t: \
+                        proper(xmltooling::XMLConstants::XML_BOOL_TRUE); \
+                        break; \
+                    case chLatin_f: \
+                        proper(xmltooling::XMLConstants::XML_BOOL_FALSE); \
+                        break; \
+                    case chDigit_1: \
+                        proper(xmltooling::XMLConstants::XML_BOOL_ONE); \
+                        break; \
+                    case chDigit_0: \
+                        proper(xmltooling::XMLConstants::XML_BOOL_ZERO); \
+                        break; \
+                    default: \
+                        proper(xmltooling::XMLConstants::XML_BOOL_NULL); \
+                } \
+            } \
+            else \
+                proper(xmltooling::XMLConstants::XML_BOOL_NULL); \
+        }
 
 /**
  * Implements get/set methods and a private member for a typed XML attribute.
     IMPL_XMLOBJECT_ATTRIB(proper,XMLCh)
 
 /**
- * Implements get/set methods and a private member for a DateTime XML attribute.
+ * Implements get/set methods and a private member for a string XML attribute,
+ * plus a getXMLID override.
  * 
  * @param proper    the proper name of the attribute
  */
-#define IMPL_DATETIME_ATTRIB(proper) \
-    IMPL_XMLOBJECT_ATTRIB(proper,xmltooling::DateTime); \
-    void set##proper(time_t proper) { \
-        m_##proper = prepareForAssignment(m_##proper,proper); \
-    } \
-    void set##proper(const XMLCh* proper) { \
-        m_##proper = prepareForAssignment(m_##proper,proper); \
+#define IMPL_ID_ATTRIB(proper) \
+    IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \
+    const XMLCh* getXMLID() const { \
+        return m_##proper; \
     }
 
 /**
+ * Implements get/set methods and a private member for a DateTime XML attribute.
+ * 
+ * @param proper    the proper name of the attribute
+ * @param fallback  epoch to return when attribute is NULL
+ */
+#define IMPL_DATETIME_ATTRIB(proper,fallback) \
+    protected: \
+        DateTime* m_##proper; \
+        time_t m_##proper##Epoch; \
+    public: \
+        const DateTime* get##proper() const { \
+            return m_##proper; \
+        } \
+        time_t get##proper##Epoch() const { \
+            return m_##proper ? m_##proper##Epoch : fallback; \
+        } \
+        void set##proper(const DateTime* proper) { \
+            m_##proper = prepareForAssignment(m_##proper,proper); \
+            if (m_##proper) \
+                m_##proper##Epoch=m_##proper->getEpoch(); \
+        } \
+        void set##proper(time_t proper) { \
+            m_##proper = prepareForAssignment(m_##proper,proper); \
+            m_##proper##Epoch = proper; \
+        } \
+        void set##proper(const XMLCh* proper) { \
+            m_##proper = prepareForAssignment(m_##proper,proper); \
+            if (m_##proper) \
+                m_##proper##Epoch=m_##proper->getEpoch(); \
+        }
+
+/**
  * Implements get/set methods and a private member for an integer XML attribute.
  * 
  * @param proper    the proper name of the attribute
  */
 #define IMPL_INTEGER_ATTRIB(proper) \
     protected: \
-        int m_##proper; \
+        XMLCh* m_##proper; \
     public: \
-        int get##proper() const { \
-            return m_##proper; \
+        pair<bool,int> get##proper() const { \
+            return make_pair((m_##proper!=NULL),(m_##proper!=NULL ? XMLString::parseInt(m_##proper): 0)); \
+        } \
+        void set##proper(const XMLCh* proper) { \
+            m_##proper = prepareForAssignment(m_##proper,proper); \
         } \
         void set##proper(int proper) { \
-            if (m_##proper != proper) { \
-                releaseThisandParentDOM(); \
-                m_##proper = proper; \
-            } \
+            char buf##proper[64]; \
+            sprintf(buf##proper,"%d",proper); \
+            auto_ptr_XMLCh wide##proper(buf##proper); \
+            set##proper(wide##proper.get()); \
         }
 
 /**
  */
 #define IMPL_BOOLEAN_ATTRIB(proper) \
     protected: \
-        bool m_##proper; \
+        XMLConstants::xmltooling_bool_t m_##proper; \
     public: \
-        bool proper() const { \
+        XMLConstants::xmltooling_bool_t get##proper() const { \
             return m_##proper; \
         } \
-        void proper(bool value) { \
+        void proper(XMLConstants::xmltooling_bool_t value) { \
             if (m_##proper != value) { \
                 releaseThisandParentDOM(); \
                 m_##proper = value; \
         }
 
 /**
+ * Implements get/set methods and a private list iterator member for
+ * a typed XML child object in a foreign namespace
+ * 
+ * @param proper    the proper name of the child type
+ * @param ns        the C++ namespace for the type
+ */
+#define IMPL_TYPED_FOREIGN_CHILD(proper,ns) \
+    protected: \
+        ns::proper* m_##proper; \
+        std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
+    public: \
+        ns::proper* get##proper() const { \
+            return m_##proper; \
+        } \
+        void set##proper(ns::proper* child) { \
+            prepareForAssignment(m_##proper,child); \
+            *m_pos_##proper = m_##proper = child; \
+        }
+
+/**
  * Implements get/set methods and a private list iterator member for a generic XML child object.
  * 
  * @param proper    the proper name of the child
         } 
 
 /**
+ * Implements get method and a private vector member for a typed XML child collection
+ * in a foreign namespace.
+ * 
+ * @param proper    the proper name of the child type
+ * @param ns        the C++ namespace for the type
+ * @param fence     insertion fence for new objects of the child collection in backing list
+ */
+#define IMPL_TYPED_FOREIGN_CHILDREN(proper,ns,fence) \
+    protected: \
+        std::vector<ns::proper*> m_##proper##s; \
+    public: \
+        VectorOf(ns::proper) get##proper##s() { \
+            return VectorOf(ns::proper)(this, m_##proper##s, &m_children, fence); \
+        } \
+        const std::vector<ns::proper*>& get##proper##s() const { \
+            return m_##proper##s; \
+        } 
+
+/**
  * Implements get method and a private vector member for a generic XML child collection.
  * 
  * @param proper    the proper name of the child
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_STRING_ATTRIB(proper,ucase,namespaceURI) \
-    if(get##proper()) { \
-        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, get##proper()); \
+    if (m_##proper) { \
+        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
     }
 
 /**
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_DATETIME_ATTRIB(proper,ucase,namespaceURI) \
-    if(get##proper()) { \
-        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, get##proper()->getRawData()); \
+    if (m_##proper) { \
+        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper->getRawData()); \
     }
 
 /**
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
-    char buf##proper[64]; \
-    sprintf(buf##proper,"%d",get##proper()); \
-    auto_ptr_XMLCh wide##proper(buf##proper); \
-    domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, wide##proper.get())
+    if (m_##proper) { \
+        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
+    }
 
 /**
  * Implements marshalling for a boolean attribute
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
-    XMLCh flag##proper[2]; \
-    flag##proper[0]=m_##proper ? chDigit_1 : chDigit_0; \
-    flag##proper[1]=chNull; \
-    domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, flag##proper)
+    switch (m_##proper) { \
+        case XMLConstants::XML_BOOL_TRUE: \
+            domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_TRUE); \
+            break; \
+        case XMLConstants::XML_BOOL_ONE: \
+            domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_ONE); \
+            break; \
+        case XMLConstants::XML_BOOL_FALSE: \
+            domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_FALSE); \
+            break; \
+        case XMLConstants::XML_BOOL_ZERO: \
+            domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_ZERO); \
+            break; \
+        case XMLConstants::XML_BOOL_NULL: \
+            break; \
+    }
 
 /**
  * Implements marshalling for a QName attribute
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_QNAME_ATTRIB(proper,ucase,namespaceURI) \
-    if(get##proper()) { \
-        auto_ptr_XMLCh qstr(get##proper()->toString().c_str()); \
+    if (m_##proper) { \
+        auto_ptr_XMLCh qstr(m_##proper->toString().c_str()); \
         domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, qstr.get()); \
     }
 
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \
-    if(get##proper()) { \
-        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, get##proper()); \
+    if (m_##proper) { \
+        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
         domElement->setIdAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \
     }
 
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define PROC_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
-    if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
-        set##proper(XMLString::parseInt(attribute->getValue())); \
-        return; \
-    }
+    PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
 
 /**
  * Implements unmarshalling process branch for a boolean attribute
  * @param namespaceURI  the XML namespace of the attribute
  */
 #define PROC_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
-    if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
-        const XMLCh* value=attribute->getValue(); \
-        if (value) { \
-            if (*value==chLatin_t || *value==chDigit_1) \
-                m_##proper=true; \
-            else if (*value==chLatin_f || *value==chDigit_0) \
-                m_##proper=false; \
-        } \
-        return; \
-    }
+    PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
 
 /**
  * Implements unmarshalling process branch for typed child collection element
     }
 
 /**
+ * Implements unmarshalling process branch for typed child collection element
+ * in a foreign namespace.
+ * 
+ * @param proper        the proper name of the child type
+ * @param ns            the C++ namespace for the type
+ * @param namespaceURI  the XML namespace of the child element
+ * @param force         bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_FOREIGN_CHILDREN(proper,ns,namespaceURI,force) \
+    if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
+        ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
+        if (typesafe) { \
+            get##proper##s().push_back(typesafe); \
+            return; \
+        } \
+    }
+
+/**
  * Implements unmarshalling process branch for typed child singleton element
  * 
  * @param proper        the proper name of the child type
     }
 
 /**
+ * Implements unmarshalling process branch for typed child singleton element
+ * in a foreign namespace.
+ * 
+ * @param proper        the proper name of the child type
+ * @param ns            the C++ namespace for the type
+ * @param namespaceURI  the XML namespace of the child element
+ * @param force         bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_FOREIGN_CHILD(proper,ns,namespaceURI,force) \
+    if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
+        ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
+        if (typesafe) { \
+            set##proper(typesafe); \
+            return; \
+        } \
+    }
+
+/**
  * Implements unmarshalling process branch for a generic child singleton element
  * 
  * @param proper        the proper name of the child type
     }
 
 /**
- * Declares aliased get/set methods for named XML element content.
+ * Declares aliased get/set methods for named XML element simple content.
  * 
  * @param proper    the proper name to label the element's content
  */
-#define DECL_XMLOBJECT_CONTENT(proper) \
+#define DECL_SIMPLE_CONTENT(proper) \
     XMLTOOLING_DOXYGEN(Returns proper.) \
     const XMLCh* get##proper() const { \
         return getTextContent(); \
  * @param proper    the proper name to label the element's content
  */
 #define DECL_INTEGER_CONTENT(proper) \
-    XMLTOOLING_DOXYGEN(Returns proper.) \
-    int get##proper() const { \
-        return XMLString::parseInt(getTextContent()); \
+    XMLTOOLING_DOXYGEN(Returns proper in integer form after a NULL indicator.) \
+    std::pair<bool,int> get##proper() const { \
+        return std::make_pair((getTextContent()!=NULL), (getTextContent()!=NULL ? XMLString::parseInt(getTextContent()) : NULL)); \
     } \
-    XMLTOOLING_DOXYGEN(Sets or clears proper.) \
+    XMLTOOLING_DOXYGEN(Sets proper.) \
     void set##proper(int proper) { \
         char buf[64]; \
         sprintf(buf,"%d",proper); \
         xmltooling::auto_ptr_XMLCh widebuf(buf); \
         setTextContent(widebuf.get()); \
+    } \
+    XMLTOOLING_DOXYGEN(Sets or clears proper.) \
+    void set##proper(const XMLCh* proper) { \
+        setTextContent(proper); \
     }
 
 /**
- * Implements marshalling/unmarshalling for element content.
- */
-#define IMPL_XMLOBJECT_CONTENT \
-    protected: \
-        void marshallElementContent(DOMElement* domElement) const { \
-            if(getTextContent()) { \
-                domElement->appendChild(domElement->getOwnerDocument()->createTextNode(getTextContent())); \
-            } \
-        } \
-        void processElementContent(const XMLCh* elementContent) { \
-            setTextContent(elementContent); \
-        }
-
-
-/**
  * Implements cloning methods for an XMLObject specialization implementation class.
  * 
  * @param cname    the name of the XMLObject specialization
  * @param desc      documentation for class
  */
 #define DECL_XMLOBJECT_SIMPLE(linkage,cname,proper,desc) \
-    BEGIN_XMLOBJECT(linkage,cname,xmltooling::SimpleElement,desc); \
-        DECL_XMLOBJECT_CONTENT(proper); \
+    BEGIN_XMLOBJECT(linkage,cname,xmltooling::XMLObject,desc); \
+        DECL_SIMPLE_CONTENT(proper); \
     END_XMLOBJECT
 
 /**
     class linkage cname##Impl \
         : public virtual cname, \
             public xmltooling::AbstractSimpleElement, \
-            public xmltooling::AbstractChildlessElement, \
             public xmltooling::AbstractDOMCachingXMLObject, \
-            public xmltooling::AbstractValidatingXMLObject, \
             public xmltooling::AbstractXMLObjectMarshaller, \
             public xmltooling::AbstractXMLObjectUnmarshaller \
     { \
         cname##Impl(const cname##Impl& src) \
             : xmltooling::AbstractXMLObject(src), \
                 xmltooling::AbstractSimpleElement(src), \
-                xmltooling::AbstractDOMCachingXMLObject(src), \
-                xmltooling::AbstractValidatingXMLObject(src) {} \
+                xmltooling::AbstractDOMCachingXMLObject(src) {} \
         IMPL_XMLOBJECT_CLONE(cname) \
-        IMPL_XMLOBJECT_CONTENT \
     }
     
 /**
     { \
     public: \
         virtual ~cname##SchemaValidator() {} \
-        virtual cname##SchemaValidator* clone() const { \
-            return new cname##SchemaValidator(); \
-        } \
+        virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
+            const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
+            if (!ptr) \
+                throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name()))
+
+/**
+ * Begins the declaration of a Schema Validator specialization subclass.
+ * 
+ * @param linkage   linkage specifier for the class
+ * @param cname     the base name of the Validator specialization
+ * @param base      base class for the validator
+ */
+ #define BEGIN_XMLOBJECTVALIDATOR_SUB(linkage,cname,base) \
+    class linkage cname##SchemaValidator : public base##SchemaValidator \
+    { \
+    public: \
+        virtual ~cname##SchemaValidator() {} \
         virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
             const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
             if (!ptr) \
         throw xmltooling::ValidationException(#cname" must have "#proper".")
 
 /**
+ * Validator code that checks for a required integer attribute
+ * 
+ * @param cname     the name of the XMLObject specialization
+ * @param proper    the proper name of the attribute, content, or singleton member 
+ */
+#define XMLOBJECTVALIDATOR_REQUIRE_INTEGER(cname,proper) \
+    if (!ptr->get##proper().first) \
+        throw xmltooling::ValidationException(#cname" must have "#proper".")
+
+/**
  * Validator code that checks for one of a pair of
  * required attributes, content, or singletons.
  *