JFACTORY-GETXML-001
JFactory::getXML()
Factory::getXml() / JXMLElement
JXMLElement and Factory::getXml were removed. PHP's SimpleXML is the replacement.
JFactory::getXML() → SimpleXMLElement
What you will see
- Class "JXMLElement" not found
- Call to undefined method Factory::getXml
Symptoms people search
manifest parse fatal
Replace this code
Swap JFactory::getXML() for SimpleXMLElement.
Joomla 3
Remove or stop calling this
$xml = JFactory::getXML($path, true);Joomla 4 / 6
Use this instead
$xml = simplexml_load_file($path);
// or new \SimpleXMLElement($string)How to fix it
- 1Use simplexml_load_file or SimpleXMLElement.
- 2Add error handling — SimpleXML returns false on bad XML.
Also known as
JXMLElement · getXML · getXml
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getEditor()
JFactory::getEditor() → Editor::getInstance()
- Joomla 3 → 4Joomla API
JHtmlBatch
JHtmlBatch → Layouts joomla.html.batch.*