Xml Class Reference

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 | ) |
| Xml::header | ( | $ | attrib = array() |
) |
| 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 | ( | ) |
| 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 | ( | ) |
| 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 | ( | ) |
| 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() |
) |
Member Data Documentation
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/xml.php