本文整理汇总了C++中DOMImplementation::createDOMBuilder方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMImplementation::createDOMBuilder方法的具体用法?C++ DOMImplementation::createDOMBuilder怎么用?C++ DOMImplementation::createDOMBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMImplementation
的用法示例。
在下文中一共展示了DOMImplementation::createDOMBuilder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: impl
XMLParser::XMLParser() {
using namespace xercesc;
namespace xml = xsd::cxx::xml;
namespace tree = xsd::cxx::tree;
_memMgr = new MemoryManagerImpl();
_grammarPool = new XMLGrammarPoolImpl(_memMgr);
const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull};
// Get an implementation of the Load-Store (LS) interface.
//
DOMImplementation* impl (
DOMImplementationRegistry::getDOMImplementation (ls_id));
// Create a DOMBuilder.
//
// TODO: make this a class-member and initialize just once
parser = impl->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0, _memMgr, _grammarPool);
// Discard comment nodes in the document.
//
parser->setFeature (XMLUni::fgDOMComments, false);
// Enable datatype normalization.
//
parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true);
// Do not create EntityReference nodes in the DOM tree. No
// EntityReference nodes will be created, only the nodes
// corresponding to their fully expanded substitution text
// will be created.
//
//parser->setFeature (XMLUni::fgDOMEntities, false);
parser->setFeature (XMLUni::fgDOMEntities, true);
// Perform Namespace processing.
//
parser->setFeature (XMLUni::fgDOMNamespaces, true);
// Do not include ignorable whitespace in the DOM tree.
//
parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false);
parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
// We will release the DOM document ourselves.
//
parser->setFeature (XMLUni::fgXercesUserAdoptsDOMDocument, true);
// Enable grammar caching and load known grammars
parser->loadGrammar((INSTALL_PREFIX + std::string("/etc/xbe/schema/xbe-msg.xsd")).c_str(), Grammar::SchemaGrammarType, true);
parser->loadGrammar((INSTALL_PREFIX + std::string("/etc/xbe/schema/dsig.xsd")).c_str(), Grammar::SchemaGrammarType, true);
parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
}