Re: PostgreSQL 9.3 XML parser seems not to recognize the DOCTYPE element in XML files

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL 9.3 XML parser seems not to recognize the DOCTYPE element in XML files
Date: 2014-06-04 19:29:18
Message-ID: 1401910158471-5806063.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut-2 wrote
> On 5/29/14, 11:59 AM, Bob Moyers wrote:
>> When I try this update:
>>
>> UPDATE REPORT_STYLE SET JASPER_STYLE = XMLPARSE(DOCUMENT ?) WHERE
>> (REPORT_STYLE_NAME = ?)
>>
>>
>>
>> I get:
>>
>> org.postgresql.util.PSQLException: ERROR: invalid XML content
>>
>> Detail: line 2: StartTag: invalid element name
>>
>> &lt;!DOCTYPE jasperTemplate PUBLIC &quot;-//JasperReports//DTD
>> Template//EN&quot;
> &gt; "http://jas
>
> This could be a problem with the JDBC driver's handling of xmlparse.
> Maybe you could help some debugging help on their mailing list. Also
> check the server log. Maybe you can see there what the server actually
> received.

So I tested a "SELECT XMLPARSE(DOCUMENT ?)" query using the 9.0-801 driver
against a 9.0 server and did not encounter the parsing error described.

It would help to show the actual Java code you are using, especially the
parameter setValue calls, as I am guessing that the unknown typed first
parameter is being immediately cast to "xml" - before being fed to XMLPARSE.
If that is the case then the server's default of CONTENT would be in effect
and you would get the error in question. You must ensure you pass in a
string for the first parameter.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Re-PostgreSQL-9-3-XML-parser-seems-not-to-recognize-the-DOCTYPE-element-in-XML-files-tp5805492p5806063.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Newton 2014-06-04 21:42:10 Re: pg_largeobject high overhead
Previous Message Keith Fiske 2014-06-04 17:50:31 Re: Merge a sharded master into a single read-only slave