API16

JXMLElement/data: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 4: Line 4:




{{subst:Description:JXMLElement/data}}
 


===Syntax===
===Syntax===
Line 27: Line 27:




{{subst:SeeAlso:JXMLElement/data}}
 


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=data
  category=data
  category=JXMLElement
  category=JXMLElement
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>

Latest revision as of 02:17, 25 March 2017

Description

LEGACY - Gets the element 'data'.



Syntax

data()


Returns

string

Defined in

libraries/joomla/utilities/xmlelement.php

Importing

jimport( 'joomla.utilities.xmlelement' );

Source Body

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



Examples

Code Examples

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