From a006ee0019a86b13be4007bbe4971e461ff53d8d Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sat, 11 Sep 2010 22:20:21 -0300 Subject: [PATCH] Updating docs. --- cake/libs/xml.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 570a8ab4cb4..f3153b2e49c 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -23,7 +23,7 @@ class Xml { /** - * Initialize SimpleXMLElement from a given XML string, file path, URL or array. + * Initialize SimpleXMLElement or DOMDocument from a given XML string, file path, URL or array. * * ### Usage: * @@ -31,6 +31,10 @@ class Xml { * * `$xml = Xml::build('text');` * + * Building XML from string (output DOMDocument): + * + * `$xml = Xml::build('text', array('return' => 'domdocument'));` + * * Building XML from a file path: * * `$xml = Xml::build('/path/to/an/xml/file.xml');` @@ -61,8 +65,14 @@ class Xml { * * When building XML from an array ensure that there is only one top level element. * + * ### Options + * + * - `return` Can be 'simplexml' to return object of SimpleXMLElement or 'domdocument' to return DOMDocument. + * - If using array as input, you can pass `options` from Xml::fromArray. + * * @param mixed $input XML string, a path to a file, an URL or an array - * @return object SimpleXMLElement + * @param array $options The options to use + * @return object SimpleXMLElement or DOMDocument * @throws Exception */ public static function build($input, $options = array()) {