10 defined(
'JPATH_PLATFORM') or die;
32 public function name()
34 JLog::add(
'JXMLElement::name() is deprecated, use SimpleXMLElement::getName() instead.',
JLog::WARNING,
'deprecated');
35 return (
string) $this->getName();
50 public function asFormattedXML($compressed =
false, $indent =
"\t", $level = 0)
52 JLog::add(
'JXMLElement::asFormattedXML() is deprecated, use SimpleXMLElement::asXML() instead.',
JLog::WARNING,
'deprecated');
56 $out .= ($compressed) ?
'' :
"\n" . str_repeat($indent, $level);
59 $out .=
'<' . $this->getName();
62 foreach ($this->attributes() as $attr)
64 $out .=
' ' . $attr->getName() .
'="' . htmlspecialchars((
string) $attr, ENT_COMPAT,
'UTF-8') .
'"';
68 if (!count($this->children()) && !(
string) $this)
75 if (count($this->children()))
83 foreach ($this->children() as $child)
85 $out .= $child->asFormattedXML($compressed, $indent, $level);
91 $out .= ($compressed) ?
'' :
"\n" . str_repeat($indent, $level);
94 elseif ((
string) $this)
97 $out .=
'>' . htmlspecialchars((
string) $this, ENT_COMPAT,
'UTF-8');
101 $out .=
'</' . $this->getName() .
'>';