Project

General

Profile

Actions

Defect #6345

closed

xml used by rest API is invalid

Added by Florent Fievez over 13 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
Start date:
2010-09-09
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The xml format used by REST API to insert a bug seem to be invalid. In forum page : http://www.redmine.org/boards/2/topics/17070 an example show the following :

<issue>
<project_id>1</project_id>
<tracker_id>1</tracker_id>
<subject>test2</subject>
<description>desc1gsdfgsdg</description>
<custom_field_values>
<1>test</1>
</custom_field_values>
</issue>

Except that this XML code is invalid. Indeed:
http://www.w3.org/TR/2008/REC-xml-20081126/#NT-NameStartChar
specify that every node should start by a char within :

    NameStartChar       ::=       ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

The result is that you cannot generate xml with DOM API. Currently, I use DOM but with a very bad workaround :

$aElem = $aXmlDoc->createElement("_TOREMOVE_1");
(...)
$aXmlOut = str_replace("_TOREMOVE_","",$aXmlDoc->saveXML($aRoot));

Can you try to fix it ?

Actions

Also available in: Atom PDF