Actions

CodeExample

4d3084f89e0ff

From Joomla! Documentation

Get the attribute of an element

demo.xml

<jdoc>
        <doku kategory="Info">Wiki</doku>
</jdoc>
<?php
 
$xml = JFactory::getXML('demo.xml');
 
echo $xml->doku->getAttribute('kategory');
 
/* Better: */
echo $xml->doku->attributes()->kategory;

Output:

Info

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