Document: ezcDocumentElementVisitorConverter
[ ]
[ Conversion ] [ Styles ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocumentElementVisitorConverter
|
Basic converter which stores a list of handlers for each node in the docbook element tree. Those handlers will be executed for the elements, when found. [
source]
The handler can then handle the repective subtree.
Additional handlers may be added by the user to the converter class.
Parents
ezcDocumentConverter
|
--ezcDocumentElementVisitorConverter
Descendents
Member Variables
|
protected string |
$defaultNamespace
= 'docbook'
Deafult document namespace
If no namespace has been explicitely declared in the source document assume this as the defalt namespace. |
|
protected SplObjectStorage |
$storage
Opject storage to check for reprocessing of DOMNodes, which may cause error which are hard to debug. |
|
protected array |
$visitorElementHandler
= array()
Element handlers
Element handlers for elements per namespace. The namespace names may be names, which might have document specific meaning, like "docbook" for all different docbook versions, or a namespace URI. The handler is as an object of a class inheriting from ezcDocumentDocbookElementVisitorHandler. |
Inherited Member Variables
From
ezcDocumentConverter:
Method Summary
|
public ezcDocumentDocument |
convert(
$source )
Convert documents between two formats |
|
protected abstract ezcDocumentDocument |
createDocument(
$content )
Create document from structure |
|
protected abstract mixed |
initializeDocument(
)
Initialize destination document |
|
public void |
setElementHandler(
$namespace, $element, $handler )
Set custom element handler |
|
public mixed |
visitChildren(
$node, $root )
Recursively visit children of a document node. |
|
protected void |
visitElement(
$node, $root )
Visit DOMElement nodes. |
|
public mixed |
visitNode(
$node, $root )
Visit a single document node |
|
protected abstract mixed |
visitText(
$text, $root )
Visit text node. |
Inherited Methods
From
ezcDocumentConverter :
Methods
convert
Convert documents between two formats
Convert documents of the given type to the requested type.
Parameters
Redefinition of
Redefined in descendants as
createDocument
ezcDocumentDocument createDocument(
mixed
$content )
Create document from structure
Build a ezcDocumentDocument object from the structure created during the visiting process.
Parameters
| Name |
Type |
Description |
$content |
mixed |
|
Redefined in descendants as
initializeDocument
mixed initializeDocument(
)
Initialize destination document
Initialize the structure which the destination document could be build with. This may be an initial DOMDocument with some default elements, or a string, or something else.
Redefined in descendants as
setElementHandler
Set custom element handler
Set handler for yet unhandled element or overwrite the handler of an existing element.
Parameters
visitChildren
mixed visitChildren(
$node, mixed
$root )
Recursively visit children of a document node.
Recurse through the whole document tree and call the defined callbacks for node transformations, defined in the class property $visitorElementHandler.
Parameters
| Name |
Type |
Description |
$node |
DOMNode |
|
$root |
mixed |
|
visitElement
void visitElement(
$node, mixed
$root )
Visit DOMElement nodes.
Parameters
| Name |
Type |
Description |
$node |
DOMNode |
|
$root |
mixed |
|
visitNode
mixed visitNode(
$node, mixed
$root )
Visit a single document node
Visit a single document node and look up the correct visitor and us it to handle the node.
Parameters
| Name |
Type |
Description |
$node |
DOMNode |
|
$root |
mixed |
|
visitText
mixed visitText(
$text, mixed
$root )
Visit text node.
Visit a text node in the source document and transform it to the destination result
Parameters
| Name |
Type |
Description |
$text |
DOMText |
|
$root |
mixed |
|
Redefined in descendants as
Last updated: Mon, 21 Dec 2009