[OSM-dev] Internal server error on relation member without role
Shaun McDonald
shaun at shaunmcdonald.me.uk
Mon Nov 17 23:38:30 GMT 2008
On 17 Nov 2008, at 21:46, Hugh Barnes wrote:
> On Tuesday 18 November 2008, 05:42:18, Shaun McDonald did write:
>> Due to the way that the XML parsing is done, if no role attribute is
>> supplied in the xml, then it will fail. Supplying role="" is what you
>> are required to do.
>
> Sorry - I'm just curious. Is this in OSM code or are you making a
> generic
> statement? If the former, it's a bug (if we're having to work around
> it) or
> it's just an unintuitive content model. If the latter, it doesn't
> ring true
> for any parsing I've done elsewhere.
>
It is whenever the XML that you give to the API is parsed into a set
of model objects that is used by the server for further processing.
See the following method (def self.from_xml_node(pt, create=false)):
http://trac.openstreetmap.org/browser/sites/rails_port_branches/api06/app/models/relation.rb#L32
If any of the parts of the XML there are missing, when they are
expected, then it will just fail with an error, probably a 500 error.
Shaun
More information about the dev
mailing list