From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chapman Flack <chap@anastigmatix.net>
Cc: Ryan Lambert <ryan@rustprooflabs.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Fix XML handling with DOCTYPE
Date: Sat, 23 Mar 2019 16:59:04 -0400
Message-ID: <12135.1553374744@sss.pgh.pa.us> (raw)
In-Reply-To: <5C8FD4EE.7090107@anastigmatix.net>
References: <CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com>
<5C8D5D16.7090206@anastigmatix.net>
<23319.1552769738@sss.pgh.pa.us>
<5C8D6681.4070504@anastigmatix.net>
<24203.1552771272@sss.pgh.pa.us>
<5C8D79AF.7010204@anastigmatix.net>
<5146.1552837534@sss.pgh.pa.us>
<5C8E7FC0.8040401@anastigmatix.net>
<31664.1552842991@sss.pgh.pa.us>
<5C8E8E2F.9050600@anastigmatix.net>
<25228.1552849567@sss.pgh.pa.us>
<5C8ECAA4.3090301@anastigmatix.net>
<5C8FD4EE.7090107@anastigmatix.net>
Chapman Flack <chap@anastigmatix.net> writes:
> I decided, for a first point of reference, to wear the green eyeshade and
> write a pre-check that exactly implements the applicable rules. That gives
> a starting point for simplifications that are probably safe.
> For example, a bunch of lines at the end have to do with verifying the
> content inside of a processing-instruction, after finding where it ends.
> We could reasonably decide that, for the purpose of skipping it, knowing
> where it ends is enough, as libxml will parse it next and report any errors
> anyway.
Yeah, I did not like that code too much, particularly not all the magic
Unicode-code-point numbers. I removed that, made some other changes to
bring the patch more in line with PG coding style, and pushed it.
> That made me just want to try it now, and--surprise!--the messages from
> libxml are not the same. So maybe I would lean to keeping the green-eyeshade
> rules in the test, if you can stomach them, but I would understand taking
> them out.
I doubt anyone will care too much about whether error messages for bad
XML input are exactly like what they were before; and even if someone
does, I doubt that these extra tests would be enough to ensure that
the messages don't change. You're not really validating that the input
is something that libxml would accept, unless its processing of XML PIs
is far stupider than I would expect it to be.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, chap@anastigmatix.net, ryan@rustprooflabs.com
Subject: Re: Fix XML handling with DOCTYPE
In-Reply-To: <12135.1553374744@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox