[TYPO3-core] RFC: Bug #9217: typo3ajax::renderAsXML does not always render XML

Francois Suter fsuter at cobweb.ch
Mon Aug 25 15:39:18 CEST 2008


Hi,

> OK, so the class has currently an array that will be auto-converted to
> XML via t3lib_div::array2xml? Now you want to support manually crafted XML?

Actually it's the opposite :-)

Currently the method expects already formed XML, but that is contrary to 
the logic of the other render methods in the same class (for example, 
the renderAsJSON encodes the stuff as JSON for you).

> Why not only test if $this->content is an array or a string. If it's the
>  former it will be passed trough t3lib_div::array2xml if it's the latter
> it will be sent as-is. Anything else throws an exception or returns FALSE.

$this->content is always an array.

> I don't like the fact that $this->contain may contain different data
> types but your patches do the same.

I don't like it either. Which is why I think it should just be an array 
containing simple values and the render methods should take care of the 
format conversion.

Benni thought of the test for backwards compatibility, if some people 
already had code feeding XML to $this->content.

This is not easy to explain :-)

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-team-core mailing list