Xml Class Reference

Inheritance diagram for Xml:

XmlNode Object

List of all members.


Public Member Functions

 addNamespace ($prefix, $url)
 compose ($options=array())
 error ($msg, $code=0, $line=0)
 getError ($code)
 header ($attrib=array())
 load ($input)
next ()
parent ()
 parse ()
previous ()
 resolveNamespace ($name, $url)
 toString ($options=array())

Static Public Member Functions

 addGlobalNamespace ($name, $url=null)
 addGlobalNs ($name, $url=null)
 options ($options=array())
 removeGlobalNamespace ($name, $url=null)
 removeGlobalNs ($name)

Public Attributes

 $encoding = 'UTF-8'
 $version = '1.0'

Detailed Description

Definition at line 672 of file xml.php.


Member Function Documentation

Xml::addGlobalNamespace ( name,
url = null 
) [static]

Alias to Xml::addNs

public

Definition at line 1022 of file xml.php.

References $url, and addGlobalNs().

Xml::addGlobalNs ( name,
url = null 
) [static]

Adds a namespace to any XML documents generated or parsed

Parameters:
string $name The namespace name
string $url The namespace URI; can be empty if in the default namespace map
Returns:
boolean False if no URL is specified, and the namespace does not exist default namespace map, otherwise true public

Definition at line 986 of file xml.php.

References $url, XmlManager::getInstance(), and resolveNamespace().

Referenced by addGlobalNamespace(), and XmlNode::addNamespace().

Xml::addNamespace ( prefix,
url 
)

Adds a namespace to the current document

Parameters:
string $prefix The namespace prefix
string $url The namespace DTD URL
Returns:
void

Reimplemented from XmlNode.

Definition at line 913 of file xml.php.

References $url, and XmlNode::children().

Xml::compose ( options = array()  ) 

Returns a string representation of the XML object

Parameters:
mixed $options If boolean: whether to include the XML header with the document (defaults to true); if array: overrides the default XML generation options
Returns:
string XML data public
Deprecated:
See also:
Xml::toString()

Definition at line 846 of file xml.php.

References Object::toString().

Xml::error ( msg,
code = 0,
line = 0 
)

If debug mode is on, this method echoes an error message.

Parameters:
string $msg Error message
integer $code Error code
integer $line Line in file public

Definition at line 857 of file xml.php.

References debug(), and Configure::read().

Xml::getError ( code  ) 

Returns a string with a textual description of the error code, or FALSE if no description was found.

Parameters:
integer $code Error code
Returns:
string Error message public

Definition at line 869 of file xml.php.

Xml::header ( attrib = array()  ) 

Return a header used on the first line of the xml file

Parameters:
mixed $attrib attributes of the header element
Returns:
string formated header

Definition at line 952 of file xml.php.

Xml::load ( input  ) 

Initialize XML object from a given XML string. Returns false on error.

Parameters:
string $input XML string, a path to a file, or an HTTP resource to load
Returns:
boolean Success public

Definition at line 765 of file xml.php.

References App::import().

& Xml::next (  ) 

Get next element. NOT implemented.

Returns:
object public

Definition at line 882 of file xml.php.

Xml::options ( options = array()  )  [static]

Sets/gets global XML options

Parameters:
array $options
Returns:
array public

Definition at line 1066 of file xml.php.

References XmlManager::getInstance().

Referenced by XmlTextNode::toString(), toString(), and XmlNode::toString().

& Xml::parent (  ) 

Get parent element. NOT implemented.

Returns:
object public

Reimplemented from XmlNode.

Definition at line 902 of file xml.php.

Xml::parse (  ) 

Parses and creates XML nodes from the __rawData property.

Returns:
boolean Success public
See also:
Xml::load()
Todo:
figure out how to link attributes and namespaces

Definition at line 794 of file xml.php.

References a().

& Xml::previous (  ) 

Get previous element. NOT implemented.

Returns:
object public

Definition at line 892 of file xml.php.

Xml::removeGlobalNamespace ( name,
url = null 
) [static]

Alias to Xml::removeNs

public

Definition at line 1055 of file xml.php.

References $url, and removeGlobalNs().

Xml::removeGlobalNs ( name  )  [static]

Removes a namespace added in addNs()

Parameters:
string $name The namespace name or URI public

Definition at line 1032 of file xml.php.

References XmlManager::getInstance().

Referenced by removeGlobalNamespace().

Xml::resolveNamespace ( name,
url 
)

Resolves current namespace

Parameters:
string $name
string $url
Returns:
array

Definition at line 1001 of file xml.php.

References $url, and XmlManager::getInstance().

Referenced by addGlobalNs().

Xml::toString ( options = array()  ) 

Return string representation of current object.

Returns:
string String representation public

Definition at line 928 of file xml.php.

References options().


Member Data Documentation

Xml::$encoding = 'UTF-8'

Definition at line 727 of file xml.php.

Xml::$version = '1.0'

Definition at line 719 of file xml.php.


The documentation for this class was generated from the following file: