Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5G8u-000056-Ow for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 20:42:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5G8s-0004Lz-U9 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 20:42:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5G8s-0004I4-Kq for pgsql-hackers@lists.postgresql.org; Sat, 16 Mar 2019 20:42:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5G8l-0004LV-M2 for pgsql-hackers@postgresql.org; Sat, 16 Mar 2019 20:42:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2GKgjXd022866; Sat, 16 Mar 2019 16:42:45 -0400 From: Tom Lane To: Ryan Lambert cc: pgsql-hackers@postgresql.org Subject: Re: Fix XML handling with DOCTYPE In-reply-to: References: Comments: In-reply-to Ryan Lambert message dated "Sat, 16 Mar 2019 14:10:56 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22864.1552768965.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 16 Mar 2019 16:42:45 -0400 Message-ID: <22865.1552768965@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ryan Lambert writes: > I'm investigating the issue I reported here: > https://www.postgresql.org/message-id/flat/153478795159.1302.96175864663= 68699403%40wrigleys.postgresql.org > I'd like to work on a patch to address this issue and make it work as > advertised. Good idea, because it doesn't seem like anybody else cares ... > I see xmlParseBalancedChunkMemoryRecover that might provide the > functionality needed. TBH, our experience with libxml has not been so positive that I'd think adding dependencies on new parts of its API would be a good plan. Experimenting with different inputs, it seems like removing the "" tag is enough to make it work. So what I'm wondering about is writing something like parse_xml_decl() to skip over that. Bear in mind though that I know next to zip about XML. There may be some good reason why we don't want to strip off the !DOCTYPE part from what libxml sees. regards, tom lane