Default support for arbitrary DOM objects.
[shibboleth/xmltooling.git] / xmltooling / XMLToolingConfig.cpp
index e4e19c0..e6fe259 100644 (file)
@@ -22,6 +22,7 @@
 \r
 #include "internal.h"\r
 #include "XMLToolingConfig.h"\r
+#include "impl/UnknownElement.h"\r
 #include "util/NDC.h"\r
 \r
 #ifdef HAVE_DLFCN_H\r
@@ -49,6 +50,11 @@ XMLToolingConfig& XMLToolingConfig::getConfig()
     return g_config;\r
 }\r
 \r
+XMLToolingInternalConfig& XMLToolingInternalConfig::getInternalConfig()\r
+{\r
+    return g_config;\r
+}\r
+\r
 bool XMLToolingInternalConfig::log_config(const char* config)\r
 {\r
     try {\r
@@ -124,7 +130,13 @@ bool XMLToolingInternalConfig::init()
         //m_xsec=new XSECProvider();\r
         log.debug("XMLSec initialization complete");\r
         \r
+        m_parserPool=new ParserPool();\r
         m_lock=xercesc::XMLPlatformUtils::makeMutex();\r
+\r
+        // default registrations\r
+        XMLObjectBuilder::registerDefaultBuilder(new UnknownElementBuilder());\r
+        Marshaller::registerDefaultMarshaller(new UnknownElementMarshaller());\r
+        Unmarshaller::registerDefaultUnmarshaller(new UnknownElementUnmarshaller());\r
     }\r
     catch (const xercesc::XMLException&) {\r
         log.fatal("caught exception while initializing Xerces");\r
@@ -154,9 +166,13 @@ void XMLToolingInternalConfig::term()
     }\r
     m_libhandles.clear();\r
     \r
+    delete m_parserPool;\r
+    m_parserPool=NULL;\r
+\r
     //delete m_xsec; m_xsec=NULL;\r
     XSECPlatformUtils::Terminate();\r
     xercesc::XMLPlatformUtils::closeMutex(m_lock);\r
+    m_lock=NULL;\r
     xercesc::XMLPlatformUtils::Terminate();\r
 \r
  #ifdef _DEBUG\r