... Elxis version 2009.3 codename Aphrodite is out, download it from Elxis Download Center (EDC) ...

XML and Ampersand

From Elxis Official Documentation

Jump to: navigation, search

Since Elxis 2009.2 it is required to escape ampersand (&) and greater than or less than (> and <) characters in your XML installation files. The XML installation file should be a valid XML file. If you don't do it then the component will not be able to be installed.


Contents

Why is this?

On Elxis 2009.2 and on, XML files are handled by the native PHP's SimpleXML class that requires XML files to be proper formatted. So & > < characters should be escaped. The external third party DOMIT class, used up to Elxis 2009.1, was replaced by SimpleXMLElement. If you wish to learn more why ampersands should be escaped read this article.


Make XML installation file valid

It is very simple to make the XML installation file well formatted.


Description

If you have written HTML text in the description area of your module/bot/component/template XML installation file then you have to include this text inside CDATA.

<description>
<![CDATA[
	html description goes here
]]>
</description>


Menus

Especially for components, for which during installation a special menu is created for the administration area, we must make sure than there are no un-escaped ampersands. Ampersands are used in the menu links.

Example of wrong syntax (not escaped ampersand):

<menu link="option=com_test&task=config&hidemainmenu=1">Configuration</menu>

Example of correct syntax (escaped ampersand):

<menu link="option=com_test&amp;task=config&amp;hidemainmenu=1">Configuration</menu>

So just replace & with &amp; and you are done.

Personal tools