#include "exceptions.h"
#include "XMLToolingConfig.h"
#include "impl/UnknownElement.h"
-#include "signature/impl/XMLSecSignature.h"
+#include "signature/KeyInfo.h"
+#include "signature/Signature.h"
#include "util/NDC.h"
+#include "util/XMLConstants.h"
+#include "validation/Validator.h"
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
using namespace xmltooling;
using namespace std;
+#define REGISTER_ELEMENT(namespaceURI,cname) \
+ q=QName(namespaceURI,cname##::LOCAL_NAME); \
+ XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
+ Validator::registerValidator(q,new cname##SchemaValidator())
+
+#define REGISTER_TYPE(namespaceURI,cname) \
+ q=QName(namespaceURI,cname##::TYPE_NAME); \
+ XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
+ Validator::registerValidator(q,new cname##SchemaValidator())
+
+
DECL_EXCEPTION_FACTORY(XMLParserException);
DECL_EXCEPTION_FACTORY(XMLObjectException);
DECL_EXCEPTION_FACTORY(MarshallingException);
DECL_EXCEPTION_FACTORY(ValidationException);
DECL_EXCEPTION_FACTORY(SignatureException);
-namespace {
+namespace xmltooling {
XMLToolingInternalConfig g_config;
}
// default registrations
XMLObjectBuilder::registerDefaultBuilder(new UnknownElementBuilder());
+
+ QName q;
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,KeyInfo);
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,KeyName);
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,MgmtData);
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,RSAKeyValue);
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Exponent);
+ REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Modulus);
+ REGISTER_TYPE(XMLConstants::XMLSIG_NS,KeyInfo);
+ REGISTER_TYPE(XMLConstants::XMLSIG_NS,RSAKeyValue);
+
#ifndef XMLTOOLING_NO_XMLSEC
- XMLObjectBuilder::registerBuilder(QName(XMLConstants::XMLSIG_NS,Signature::LOCAL_NAME),new XMLSecSignatureBuilder());
+ XMLObjectBuilder::registerBuilder(QName(XMLConstants::XMLSIG_NS,Signature::LOCAL_NAME),new SignatureBuilder());
#endif
+
REGISTER_EXCEPTION_FACTORY(XMLParserException);
REGISTER_EXCEPTION_FACTORY(XMLObjectException);
REGISTER_EXCEPTION_FACTORY(MarshallingException);