void XslCopyVisitor::visit(const CompositeMarkupNode& templte) { #ifdef XSL_TRANSFORM_TRACE clog << "XslCopy on CompositeMarkupNode" << endl; #endif MarkupNode::Attributes copiedAttributes(templte.MarkupNode::begin(), templte.MarkupNode::end()); CompositeMarkupNode::Children children; CompositeMarkupNode ** myParent = _parentProxy; _parentProxy = new CompositeMarkupNode*; for (CompositeMarkupNode::ChildrenIterator it = templte.begin(); it != templte.end(); ++it) { (*it)->accept(*this); copy(_result.begin(), _result.end(), back_inserter(children)); } _result.assign( 1, new CompositeMarkupNode(myParent, templte.ns(), templte.name(), copiedAttributes, *_parentProxy, children)); _parentProxy = myParent; }
void OutputVisitor::visit(const CompositeMarkupNode& node) { doIndent(); writeMarkupOpening(node); _out << CLOSE_MARKUP_STR << endl; _indent += _indentUnit; int count = 0; for (CompositeMarkupNode::ChildrenIterator it = node.begin(); it != node.end(); ++it) { (*it)->accept(*this); } _indent -= _indentUnit; doIndent(); _out << OPEN_MARKUP_STR << CLOSING_MARKUP_STR; if (!node.ns().empty()) { _out << node.ns() << NS_SEPARATOR_STR; } _out << node.name() << CLOSE_MARKUP_STR << endl; }