Document: ezcDocument
[ ]
[ Conversion ] [ Styles ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocument
|
A base class for document type handlers. [
source]
Implemented Interfaces
Descendents
Member Variables
|
protected array |
$errors
= array()
Errors occured during the conversion process |
|
protected ezcDocumentXmlOptions |
$options
XML document base options. |
|
protected string |
$path
= './'
Current document path, where the operations happen. |
Method Summary
|
public ezcDocument |
__construct(
[$options = null] )
Construct new document |
|
public abstract void |
createFromDocbook(
$document )
Create document from docbook document |
|
public abstract ezcDocumentDocbook |
getAsDocbook(
)
Return document compiled to the docbook format |
|
public array |
getErrors(
)
Return list of errors occured during visiting the document. |
|
public string |
getPath(
)
Get document base path |
|
public void |
loadFile(
$file )
Create document from file |
|
public abstract void |
loadString(
$string )
Create document from input string |
|
public abstract string |
save(
)
Return document as string |
|
public void |
setPath(
$path )
Set document base path |
|
public void |
triggerError(
$level, $message, [$file = null], [$line = null], [$position = null] )
Trigger visitor error |
Methods
__construct
Construct new document
Parameters
createFromDocbook
Create document from docbook document
A document of the docbook format is provided and the internal document structure should be created out of this.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Parameters
Redefined in descendants as
getAsDocbook
Return document compiled to the docbook format
The internal document structure is compiled to the docbook format and the resulting docbook document is returned.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Redefined in descendants as
getErrors
array getErrors(
)
Return list of errors occured during visiting the document.
May be an empty array, if on errors occured, or a list of ezcDocumentVisitException objects.
getPath
string getPath(
)
Get document base path
loadFile
void loadFile(
string
$file )
Create document from file
Create a document of the current type handler class and parse it into a usable internal structure. The default implementation just calls loadString(), but you may want to provide an optimized implementation.
Parameters
| Name |
Type |
Description |
$file |
string |
|
loadString
void loadString(
string
$string )
Create document from input string
Create a document of the current type handler class and parse it into a usable internal structure.
Parameters
| Name |
Type |
Description |
$string |
string |
|
Redefined in descendants as
save
string save(
)
Return document as string
Serialize the document to a string an return it.
Redefined in descendants as
setPath
void setPath(
string
$path )
Set document base path
The base path will be used as a base for relative file inclusions in the document.
Parameters
| Name |
Type |
Description |
$path |
string |
|
triggerError
void triggerError(
int
$level, string
$message, [string
$file = null], [int
$line = null], [int
$position = null] )
Trigger visitor error
Emit a vistitor error, and convert it to an exception depending on the error reporting settings.
Parameters
| Name |
Type |
Description |
$level |
int |
|
$message |
string |
|
$file |
string |
|
$line |
int |
|
$position |
int |
|
Last updated: Mon, 21 Dec 2009