lara22
(Lukam 2011)
July 8, 2016, 10:49am
1
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?
patrickm
(Yiiframework)
July 8, 2016, 10:55am
2
How do you check it? With what tool?
lara22
(Lukam 2011)
July 8, 2016, 10:59am
3
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.
lara22
(Lukam 2011)
July 8, 2016, 11:07am
4
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()