API16

JXMLElement/data

From Joomla! Documentation

< API16:JXMLElement

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

LEGACY - Gets the element 'data'.



Syntax[edit]

data()


Returns[edit]

string

Defined in[edit]

libraries/joomla/utilities/xmlelement.php

Importing[edit]

jimport( 'joomla.utilities.xmlelement' );

Source Body[edit]

public function data()
{
        return (string)$this;
}



Examples[edit]

Code Examples[edit]

Get the element data

demo.xml

<jdoc>
	<doku kategory="Info">Wiki</doku>
</jdoc>
<?php

$xml = JFactory::getXML('demo.xml');

echo $xml->doku->data();

/* Better: */
echo $xml->doku;

Ausgabe:

Wiki

Elkuku 11:14, 14 January 2011 (CST) Edit comment