Actions

API16

JXMLElement/name

From Joomla! Documentation

< API16:JXMLElement
Revision as of 17:56, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Get the name of the element. Warning: don't use getName() as it's broken up to php 5.2.3

[Edit Descripton]

Description:JXMLElement/name

Syntax

name()


Returns

string

Defined in

libraries/joomla/utilities/xmlelement.php

Importing

jimport( 'joomla.utilities.xmlelement' );

Source Body

public function name()
{
        if(version_compare(phpversion(), '5.2.3', '>'))
        {
                return (string)$this->getName();
        }
 
        // workaround php bug number 41867, fixed in 5.2.4
        return (string)$this->aaa->getName();
}

[Edit See Also] SeeAlso:JXMLElement/name

Examples

<CodeExamplesForm />

Get the name of the document

demo.xml

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

Output:

jdoc

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