-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Roan Kattouw wrote:
brion@svn.wikimedia.org schreef:
Have been playing with custom API modules and been a bit frustrated with the XML output mode... Adding pseudo-element _attribs alongside _element for XML output. There doesn't seem to be a good way currently to specify both attributes *and* subelements
That works just perfectly with stuff like array('foo' => 'bar', array('*' => 'stuff')) which will translate to
<tag foo="bar"> <tag>stuff</tag> </tag>
I really don't see the point in this commit, and I'd rather see it reverted.
The basic problem seems to be overloading of attributes and sub-elements in the same array, which means you can't have both very consistently. It makes it hard to use it as a general-purpose XML output system.
If I could do this:
array( 'attrib1' => 'val1', 'attrib2' => 'val2', '*' => array( 'tag' => 'stuff' 'tag2' => 'stuff2', ) )
then that might do the job, but it doesn't seem to happy with that currently:
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /Library/WebServer/Documents/trunk/includes/Xml.php on line 31
- -- brion