255 {
256
257 const std::string& nodeName = node.
get_name();
258 const std::string& nodeValue = node.
get_value();
259 if (XMLCoreParserDebugger::debug ()){
260 std::cout << "XMLCoreParser::visit node(" << &node << ") " << nodeName << std::endl;
261 }
263 if (XMLCoreParserDebugger::debug ()){
264 std::cout << "XMLCoreParser::visit factory " << factory << std::endl;
265 }
266
270 for (const XMLCoreNode* child : children) {
272 }
273 break;
274 }
276 if (XMLCoreParserDebugger::debug ()){
277 std::cout << "XMLCoreParser::visit ELEMENT_NODE "
278 << " factory=" << factory
279 << std::endl;
280 }
281 if (factory != 0){
282 factory->
start (*
this, node);
283 } else {
284 std::cerr << "XMLCoreParser> Cannot find factory for element "
285 << nodeName << std::endl;
287 }
289 for (const XMLCoreNode* child : children) {
291 }
292 if (factory != 0) factory->
end (*
this, node);
293 break;
294 }
296 if (factory != 0) factory->
comment (*
this, nodeValue);
297 break;
298 }
300 std::cout << "ENTITY_NODE " << nodeValue << std::endl;
301 break;
302 }
304 std::cout << "ENTITY_REFERENCE_NODE " << nodeValue << std::endl;
305 break;
306 }
308 break;
309 default:
310 std::cerr <<
"Unrecognized node type = " << (long) node.
get_type() << std::endl;
311 break;
312 }
313 if (XMLCoreParserDebugger::debug ()){
314 std::cout << "XMLCoreParser::visit-2" << std::endl;
315 }
316}
void end(XMLCoreParser &parser, const XMLCoreNode &node)
void comment(XMLCoreParser &parser, const std::string &comment)
void start(XMLCoreParser &parser, const XMLCoreNode &node)
std::vector< const XMLCoreNode * > get_children(const std::string &path="*") const
Return all children matching a pattern.
NodeType get_type() const
Return the type of this node.
const std::string & get_value() const
Return the value of this node, or an empty string if no value.
const std::string & get_name() const
Return the name of this node, or an empty string if no name.
XMLCoreFactory * find_factory(const std::string &name)