Path

ez components / documentation / api reference / trunk / document


eZ Components trunk

Document: ezcDocument

[ Tutorial ] [ Conversion ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcDocument

A base class for document type handlers. [source]

Descendents

Child Class Description
ezcDocumentRst Document handler for RST text documents.
ezcDocumentWiki Document handler for RST text documents.
ezcDocumentXmlBase A base class for XML based document type handlers.

Member Variables

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 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

Methods

__construct

ezcDocument __construct( [ezcDocumentOptions $options = null] )
Construct new document

Parameters

Name Type Description
$options ezcDocumentOptions  

createFromDocbook

void createFromDocbook( ezcDocumentDocbook $document )
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

Name Type Description
$document ezcDocumentDocbook  

Redefined in descendants as

Method Description
ezcDocumentRst::createFromDocbook() Create document from docbook document
ezcDocumentWiki::createFromDocbook() Create document from docbook document
ezcDocumentXhtml::createFromDocbook() Create document from docbook document
ezcDocumentEzXml::createFromDocbook() Create document from docbook document
ezcDocumentDocbook::createFromDocbook() Create document from docbook document

getAsDocbook

ezcDocumentDocbook 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

Method Description
ezcDocumentRst::getAsDocbook() Return document compiled to the docbook format
ezcDocumentWiki::getAsDocbook() Return document compiled to the docbook format
ezcDocumentXhtml::getAsDocbook() Return document compiled to the docbook format
ezcDocumentEzXml::getAsDocbook() Return document compiled to the docbook format
ezcDocumentDocbook::getAsDocbook() Return document compiled to the docbook format

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

Method Description
ezcDocumentRst::loadString() Create document from input string
ezcDocumentWiki::loadString() Create document from input string
ezcDocumentXmlBase::loadString() Create document from input string
ezcDocumentXhtml::loadString() Create document from input string

save

string save( )
Return document as string
Serialize the document to a string an return it.

Redefined in descendants as

Method Description
ezcDocumentRst::save() Return document as string
ezcDocumentWiki::save() Return document as string
ezcDocumentXmlBase::save() Return document as string
ezcDocumentXhtml::save() Return document as string
ezcDocumentDocbook::save() Return document as string

Last updated: Mon, 10 Nov 2008