Path

ez components / documentation / api reference / 2008.1 / document


Document: ezcDocumentXmlBase

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

Class: ezcDocumentXmlBase

A base class for XML based document type handlers. [source]

Implemented Interfaces

Parents

ezcDocument
   |
   --ezcDocumentXmlBase

Descendents

Child Class Description
ezcDocumentXhtml The document handler for XHTML document markup.
ezcDocumentEzp3Xml The document handler for the eZ Publish 3 XML document markup.
ezcDocumentEzp4Xml The document handler for the eZ Publish 4 XML document markup.
ezcDocumentDocbook The document handler for the docbook document markup.

Member Variables

protected DOMDocument $document
DOM tree as the internal representation for the loaded XML.

Inherited Member Variables

From ezcDocument:
protected  ezcDocument::$options
protected  ezcDocument::$path

Method Summary

public DOMDocument getDomDocument( )
Get DOMDocument
public void loadDomDocument( $document )
Construct directly from DOMDocument
public void loadString( $string )
Create document from input string
public string save( )
Return document as string
public void setDomDocument( $document )
Set DOMDocument
public mixed validateFile( $file )
Validate the input file
public mixed validateString( $string )
Validate the input string

Inherited Methods

From ezcDocument :
public ezcDocument ezcDocument::__construct()
Construct new document
public abstract void ezcDocument::createFromDocbook()
Create document from docbook document
public abstract ezcDocumentDocbook ezcDocument::getAsDocbook()
Return document compiled to the docbook format
public void ezcDocument::loadFile()
Create document from file
public abstract void ezcDocument::loadString()
Create document from input string
public abstract string ezcDocument::save()
Return document as string

Methods

getDomDocument

DOMDocument getDomDocument( )
Get DOMDocument
Directly return the internally stored DOMDocument object, to spare additional XML parsing overhead.

loadDomDocument

void loadDomDocument( $document )
Construct directly from DOMDocument
To save execution time this method offers the construction of XML documents directly from a DOM document instance.

Parameters

Name Type Description
$document DOMDocument  

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  

Redefinition of

Method Description
ezcDocument::loadString() Create document from input string

Redefined in descendants as

Method Description
ezcDocumentDocbook::loadString() Create document from input string

save

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

Redefinition of

Method Description
ezcDocument::save() Return document as string

Redefined in descendants as

Method Description
ezcDocumentDocbook::save() Return document as string

setDomDocument

void setDomDocument( $document )
Set DOMDocument
Directly set the internally stored DOMDocument object, to spare additional XML parsing overhead. Setting a broken or invalid docbook document is not checked here, ebcause validation would cost too much performace on each set. Be careful what you set here, invalid documents may lead to unpredictable errors.

Parameters

Name Type Description
$document DOMDocument  

validateFile

mixed validateFile( string $file )
Validate the input file
Validate the input file against the specification of the current document format.
Returns true, if the validation succeded, and an array with ezcDocumentValidationError objects otherwise.

Parameters

Name Type Description
$file string  

validateString

mixed validateString( string $string )
Validate the input string
Validate the input string against the specification of the current document format.
Returns true, if the validation succeded, and an array with ezcDocumentValidationError objects otherwise.

Parameters

Name Type Description
$string string  

Last updated: Wed, 18 Jun 2008