RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::Xml::XmlVisitor Class Reference

Implements the interface to the "Visitor pattern" (see the Accept() method.) If you call the Accept() method, it requires being passed a XmlVisitor class to handle callbacks. For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simply called with Visit(). More...

Inheritance diagram for System::Xml::XmlVisitor:
System::Xml::XmlPrinter

Public Member Functions

virtual bool VisitEnter (const XmlDocument &)
 Visit a document.
 
virtual bool VisitExit (const XmlDocument &)
 Visit a document.
 
virtual bool VisitEnter (const XmlElement &, const XmlAttribute *)
 Visit an element.
 
virtual bool VisitExit (const XmlElement &)
 Visit an element.
 
virtual bool Visit (const XmlDeclaration &)
 Visit a declaration.
 
virtual bool Visit (const XmlText &)
 Visit a text node.
 
virtual bool Visit (const XmlComment &)
 Visit a comment node.
 
virtual bool Visit (const XmlUnknown &)
 Visit an unknown node.
 

Detailed Description

Implements the interface to the "Visitor pattern" (see the Accept() method.) If you call the Accept() method, it requires being passed a XmlVisitor class to handle callbacks. For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simply called with Visit().

If you return T('true') from a Visit method, recursive parsing will continue. If you return false, no children of this node or its sibilings will be Visited.

All flavors of Visit methods have a default implementation that returns T('true') (continue visiting). You need to only override methods that are interesting to you.

Generally Accept() is called on the XmlDocument, although all nodes suppert Visiting.

You should never change the document from a callback.

See also
XmlNode::Accept()

The documentation for this class was generated from the following file: