On Wed, Oct 28, 2009 at 3:22 PM, Anthony <[email protected]> wrote:
> On Wed, Oct 28, 2009 at 10:21 AM, Frederik Ramm <[email protected]> wrote:
>> Hi,
>>
>> Anthony wrote:
>>>
>>> Just took a look at the planet dump code at
>>> http://svn.openstreetmap.org/applications/utils/planet.osm/C/output_osm.c
>>>
>>> In xmlescape(): "} else if ((*in >= 0) && (*in < 32)) {
>>> escape_tmp[len] = '?'; len++; } else {"
>>
>> The planet dump code decides what gets *out* (to the planet file), not what
>> gets in (to the database) and neither what gets out over the API. If you
>> want to look at code to answer your questions then you should look at the
>> rails port (/sites/rails_port) which guards the API.
>
> My real question was "how can I parse the planet dump file".  :)
>
> I briefly skimmed through the rails_port, but not knowing ruby/rails I
> didn't get very far.  I suppose if I care I'll make a few tests
> through the dev server api.  But for now I'm content with adding "if
> (buf[ptr]<32) { fail(buf, "unexpected character data"); }" to my dump
> parser.
>
> If someone decides that's a bug in the dump code, and not a feature,
> please let us know here.

I would say that if the dump code and
http://www.w3.org/TR/REC-xml/#NT-Char
are in conflict, there's a bug in the dump code. But since I'm not
going to fix it, maybe I'll keep my opinions quiet :-)

As for the rails code, there is (AFAIK) no explicit character
checking. The server implicitly relies on libxml to ensure the
characters in the XML requests and responses are only those allowed by
the XML spec above.

Cheers,
Andy

_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev

Reply via email to