- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Io/Xml/Dom/DOMUtils.cpp

    00001
    00002 //
    00003 // Copyright (c) 2006           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00010
    00011 #include "DOMUtils.h"
    00012 #include <Mers/Utils/Io/Xml/ScopedTranscoder.h>
    00013 #include <xercesc/dom/DOM.hpp>
    00014
    00016
    00017 using namespace Mers::Utils::Io::Xml::Dom;
    00018 using Mers::Utils::Io::Xml::XMLScopedTranscoder;
    00019 using XERCES_CPP_NAMESPACE::DOMDocument;
    00020 using XERCES_CPP_NAMESPACE::DOMImplementationRegistry;
    00021 using XERCES_CPP_NAMESPACE::DOMImplementation;
    00022
    00024
    00025 Logger DOMUtils::s_logger
    00026 ( Logger::getInstance( "Mers.Utils.Io.Xml.Dom.DOMUtils" ) );
    00027
    00029
    00030 DOMImplementation * DOMUtils::getImplementation()
    00031 {
    00032         // We want an XML DOM Implementation (is there anything else?)
    00033         XMLScopedTranscoder sXMLV1("XML");
    00034
    00035         // Return the implementation.
    00036         return DOMImplementationRegistry::getDOMImplementation( sXMLV1 );
    00037 }
    00038
    00040
    00041 DOMDocument * DOMUtils::getDocument( const char * rootName )
    00042 {
    00043         // Get the implementation
    00044         DOMImplementation * impl = getImplementation();
    00045
    00046         // Translate our name.
    00047         XMLScopedTranscoder xRootName( rootName );
    00048
    00049         // Create & return our document.
    00050         return impl->createDocument(NULL, xRootName, NULL);
    00051 }
    00052
    00054