Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php
PEAR Repository - PHPDoc

PhpdocXMLWriter

PhpdocObject
   |
  +-- PhpdocXMLWriter

Creates XML documents.

 

private class PhpdocXMLWriter extends PhpdocObject

Creates XML documents.

PHPDoc uses this helper class to generate xml documents. It's
not much what this class can do but it provides some simple
functions to handle attributes and hides file handling tasks.

AuthorsUlf Wendel <ulf.wendel@phpdoc.de>
Version1.0

 

Methods inherited from PhpdocObject

setflagoutput, out, nametourl, outl, introspection

Public Method Summary

void

PhpdocXMLWriter()

Creates a new PhpdocFileHandler
void

free()

Clears the internal xml data buffer so that a new document can be passed to the object.
void

addXML(string $xml)

Adds xml to the generated xml.
void

export(string $filename)

Saves the xml to the specified file.
void

startElement(string $name, [ string $value, string $attribs, boolean $close ])

Adds an open (or single) xml tag to the generated xml.
void

endElement(string $name)

Adds a closing xml tag to the generated xml document.
void

addElement(string $name, [ string $value, string $attribs ])

Adds a complete xml container to the generated xml document.

Private Method Summary

string

xmlencode(string $value)

Encodes XML values.

Fields inherited from PhpdocObject

$err, $flag_output, $application

Private Field Summary

string

$xml

Generated XML document.
unknown

$warn

PHPDoc Warning object
unknown

$fileHandler

Filehandler used for IO operations

Public Method Details

PhpdocXMLWriter

public void PhpdocXMLWriter( )

  Creates a new PhpdocFileHandler

Returns void

See Also $filehandler

free

public void free( )

  Clears the internal xml data buffer so that a new document can be passed to the object.

Returns void


addXML

public void addXML( string $xml )

  Adds xml to the generated xml.

Parameter
string $xml
xml to append
Returns void


export

public void export( string $filename )

  Saves the xml to the specified file.

Parameter
string $filename
Name of the target file
Returns void


startElement

public void startElement( string $name, [ string $value, string $attribs, boolean $close ] )

  Adds an open (or single) xml tag to the generated xml.

Use this function to add new elements/tags to the xml document.
The tagname and all attributenames will be converted to lowercase.

Parameter
string $name
elementname (tagname)
string $value = >>""<<
value of the container: <name>value
string $attribs = >>""<<
Array of attributes: $attribs[n][type] = boolean|cdata, $attribs[n][value] = value
boolean $close = >>false<<
Flag indication that you want an empty tag like <name/>.
Returns void

See Also endElement()

endElement

public void endElement( string $name )

  Adds a closing xml tag to the generated xml document.

Parameter
string $name
Elementname (tagname)
Returns void

See Also startElement()

addElement

public void addElement( string $name, [ string $value, string $attribs ] )

  Adds a complete xml container to the generated xml document.

Parameter
string $name
Elementname (tagname)
string $value = >>""<<
Value
string $attribs = >>""<<
Attributes
Returns void

See Also startElement(), endElement()

Private Method Details

xmlencode

private string xmlencode( string $value )

  Encodes XML values.

Parameter
string $value
Returns string $value


Private Field Details

$xml

private string $xml

>>""<<


$warn

private unknown $warn

>>unknown<<


$fileHandler

private unknown $fileHandler

>>unknown<<

See Also P::P


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta