Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Thursday, 7. February 2008 schrieb Lawrence Oluyede:
> PostgreSQL 8.3 instead doesn't allow the insertion of XML with doctype
> in its new native data type returning this error message:
>
> """
> ERROR:  invalid XML content
> DETAIL:  Entity: line 2: parser error : StartTag: invalid element name
> <!DOCTYPE foo>
>  ^

It turns out that this behavior is entirely correct.  It depends on the XML 
option.  If you set the XML option to DOCUMENT, you can parse documents 
including DOCTYPE declarations.  If you set the XML option to CONTENT, then 
what you can parse is defined by the production

XMLDecl? content

which does not allow for a DOCTYPE.

The default XML option is CONTENT, which explains the behavior.

Now, the supercorrect way to parse XML values would be using the XMLPARSE() 
function, which requires you to specify the XML option inline.  That way, 
everything works.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux