![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/NodeFactory.h>
Public Member Functions | |
virtual | ~NodeFactory (void) |
virtual Document * | startMakingDocument (void) |
virtual Element * | startMakingElement (void) |
virtual Nodes | makeAttribute (void) |
virtual Nodes | makeComment (void) |
virtual Nodes | makeDocType (String rootElementName, String publicID, String systemID) |
virtual Nodes | makeProcessingInstruction (void) |
virtual Element * | makeRootElement (void) |
virtual Nodes | makeText (void) |
virtual Nodes | finishMakingElement (Element *element) |
virtual void | finishMakingDocument (Document *document) |
virtual Attribute * | makeAttribute (void *node) |
virtual Comment * | makeComment (void *node) |
virtual Document * | makeDocument (void *node) |
virtual ProcessingInstruction * | makeProcessingInstruction (void *node) |
virtual Element * | makeElement (void *node) |
virtual Text * | makeText (void *node) |
Static Public Attributes | |
static NodeFactory | default_factory |
Used for building nodes during a load. Builders use a NodeFactory object to construct each Node object (Element, Text, Attribute, etc.) they add to the tree. The default implementation simply calls the relevant constructor, stuffs the resulting Node object in a length one Nodes object, and returns it.
Subclassing this class allows builders to produce instance of subclasses (for example, HTMLElement) instead of the base classes.
Subclasses can also filter content while building. For example, namespaces could be added to or changed on all elements. Comments could be deleted. Processing instructions can be changed into elements. An xinclude:include element could be replaced with the content it references. All such changes must be consistent with the usual rules of well-formedness. For example, the makeDocType() method should not return a list containing two DocType objects because an XML document can have at most one document type declaration. Nor should it return a list containing an element, because an element cannot appear in a document prolog. However, it could return a list containing any number of comments and processing instructions, and not more than one DocType object.
|
virtual |
Signals the end of a document. The default implementation of this method does nothing. The builder does not call this method if an exception is thrown while building a document.
document | the completed Document |
Referenced by XSLTransform::toDocument().
Build an attribute from an XML node.
node | XML node. |
Build a comment from an XML node.
node | XML node. |
Referenced by Node::make().
|
virtual |
Build a document from an input stream.
node | Node used by the parser. |
Referenced by Builder::build(), and XSLTransform::transformDocument().
Build an element from its low-level reference.
node | Low-level node reference. |
Referenced by Node::make().
|
virtual |
Build a comment from an XML node.
node | XML node. |
Build a text from its low-level node reference.
node | Low-level node reference. |
Referenced by Node::make().
Creates a new Document object. The root element of this document is initially set to <root xmlns="http://www.xom.nu/fakeRoot">. This is only temporary. As soon as the real root element's start-tag is read, this element is replaced by the real root. This fake root should never be exposed.
The builder calls this method at the beginning of each document, before it calls any other method in this class. Thus this is a useful place to perform per-document initialization tasks.
Subclasses may change the root element, content, or other characteristics of the document returned. However, this method must not return null or the builder will throw a ParsingException.
Referenced by XSLTransform::toDocument().
|
static |
Default node factory.