Escaping problem when creating a XML File with createAbsoluteUrl()

Hi All,

I have created a XML Export. Everything was working fine, till I added 1 more variable to my URL (dashboard=3)

When I now check the datasource.xml I get the Error "XML Parsing Error: not well-formed".

reading about it, Xml specification doesn’t allow ‘&’ in it’s pure form. So this is how I used the createAbsoluteUrl:


Yii::app()->createAbsoluteUrl('myxml/xml', 

	array('id' => $this->id, 'version'=>$this->version,'dashboard'=>3))

I have then tried it with:


public static $ampersand='&';


Yii::app()->createAbsoluteUrl('myxml/xml', 

	array('id' => $this->id, 'version'=>$this->version,'dashboard'=>3),self::$ampersand)



But the error is still there. Any idea what I do wrong?

How do you check it? With what tool?

I actually create a zip file in it is a datasource.xml and a fields.xml When I open the zip file I can click on both files and it opens in Firefox. datasource causes the Error, fields xml is fine. When I remove the second variable everything is fine.

I think I just found my Error:




Yii::app()->createAbsoluteUrl('myxml/xml', 

        array('id' => $this->id, 'version'=>$this->version,'dashboard'=>3),self::$ampersand)



needs to be:




Yii::app()->createAbsoluteUrl('myxml/xml', 

        array('id' => $this->id, 'version'=>$this->version,'dashboard'=>3),'',self::$ampersand)



createAbsoluteUrl seems to have 4 parameters in the function not like createUrl()