Page MenuHomePhabricator

API: "action=ask&format=xml" isn't well-formed XML if a page is a subpage
Closed, InvalidPublic

Description

Snapshot of not well-formed API response.

https://wikitech.wikimedia.org/w/api.php?action=ask&query=%5b%5bCategory%3aTools%20Access%20Requests%5d%5d%20%5b%5bIs%20Completed%3a%3aNo%5d%5d%7c%3fUser%20Name&format=xml does not produce valid XML.

It has elements with the name "Nova_Resource:Tools/Access_Request/Marian_520219" which xmllint rejects with "parser error : error parsing attribute name". This stems from the slashes ("/") in the element name which aren't allowed in XML names (cf. http://www.w3.org/TR/REC-xml/#NT-NameStartChar).

After escaping those, xmllint still complains about the perceived, but undeclared XML namespace "Nova_Resource".

The result is attached as the query is volatile.


Version: unspecified
Severity: normal

Attached:

Details

Reference
bz50953

Related Objects

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:58 AM
bzimport set Reference to bz50953.
bzimport added a subscriber: Unknown Object (MLST).
Unknown Object (User) added a comment.Jul 8 2013, 4:26 PM

See Bug 44696.

I guess wikitech is not running the latests SMW 1.9 master. Bug 44696 is only deployed with SMW 1.9

Hello future me! I stumbled over this again yesterday and found that the format "wddx" is a suitable work-around; it makes the XML a bit clumsy, but parsable. So if you encounter this bug again in a year, you know what to do.