Invalid character in GPX track description or changeset comments produces bad XML in API response #4382
Comments
Author: simon04 The linked track does not contain the Notice that Ux001A is not an allowed XML character. |
Author: bastik Any update on this one? |
Author: TomH If there was I imagine the person fixing it would have commented here. |
Author: stoecker We get lots of reports on this issue. |
Author: TomH Bumping the priority is not going to produce a magic code elf to fix it though - if it's important to you then a patch is what will get things changed, not a metadata change on a bug. |
Author: don-vip We just have implemented a workaround, as it appears unlikely to see this bug fixed someday. |
Author: stoecker Replying to [comment:5 TomH]:
Increasing priority of duplicate reports actually is normal. We now have a workaround, but this issue still is not minor. The server delivers invalid XML. |
Author: TomH Well it turns out that this is very odd in fact... We are using libxml to return this so I find it hard to believe that it isn't doing the right escaping, but that does seem to be what is happening. Here is our code: which is just invoking << on an XML::Node object, which is documented here: http://xml4r.github.io/libxml-ruby/rdoc/classes/LibXML/XML/Node.html#method-i-3C-3C in turn that calls the xmlNodeAddContent function in libxml: http://xmlsoft.org/html/libxml-tree.html#xmlNodeAddContent according to which the content being added should be "raw text, so unescaped XML special chars are allowed" which suggests that it should do the escaping. |
Author: TomH Of course I also don't understand why that trace has U+1A there... I assume it is meant to be but I can't imagine that any character set would have that at 0x1a. |
Author: don-vip There's another example of bad xml delivered by OSM API. Try to get history of node 415524175: http://www.openstreetmap.org/node/415524175/history You will see that comment text of changeset 1424555 (created by Potlatch 1.0) contains exotic characters. Then our XML parser is unable to parse it: https://josm.openstreetmap.de/ticket/9647 Is there hope to see this bug fixed inside OSM API or do we need again to find a workaround ? |
Author: mmd Issue is fixed on JOSM side already: https://josm.openstreetmap.de/ticket/9647 |
Reporter: don-vip
[Submitted to the original trac issue database at 2.42pm, Saturday, 28th April 2012]
Hi,
We have a JOSM bug (#josm7648) that should be fixed on OSM server side as it will impact all applications processing XML API responses.
This track contains an invalid character in its description:
http://www.openstreetmap.org/user/CornyJoe/traces/1209300
(0x001A is not the expected German character). This cause XML parsers to fail when downloading GPX data in this area.
Is it possible to ensure GPX tracks descriptions replied by the API contain only valid XML characters ?
Thanks
The text was updated successfully, but these errors were encountered: