X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fxml.php;h=2aed3fe8edcacfc54fc7ff73589c4d5cb496a88c;hb=206c26ae30e711aa30cdb29d668bee9dce834c28;hp=c2313648cece89af0f171529a53286515d893009;hpb=f8f19038bf43aef56aae3898324a3658e2f04c14;p=friendica.git diff --git a/include/xml.php b/include/xml.php index c2313648ce..2aed3fe8ed 100644 --- a/include/xml.php +++ b/include/xml.php @@ -4,6 +4,16 @@ * */ class xml { + /** + * @brief Creates an XML structure out of a given array + * + * @param array $array The array of the XML structure that will be generated + * @param object $xml The createdXML will be returned by reference + * @param bool $remove_header Should the XML header be removed or not? + * @param array $namespaces List of namespaces + * + * @return string The created XML + */ function from_array($array, &$xml, $remove_header = false, $namespaces = array(), $root = true) { if ($root) { @@ -60,9 +70,16 @@ class xml { } } + /** + * @brief Copies an XML object + * + * @param object $source The XML source + * @param object $target The XML target + * @param string $elementname Name of the XML element of the target + */ function copy(&$source, &$target, $elementname) { if (count($source->children()) == 0) - $target->addChild($elementname, $source); + $target->addChild($elementname, xmlify($source)); else { $child = $target->addChild($elementname); foreach ($source->children() AS $childfield => $childentry)