* Initialize for xml parsing. * * As with the underlying pg_xml_init function, calls to this MUST be followed * by a PG_TRY block that guarantees that pg_xml_done is called. */
| 62 | * by a PG_TRY block that guarantees that pg_xml_done is called. |
| 63 | */ |
| 64 | PgXmlErrorContext * |
| 65 | pgxml_parser_init(PgXmlStrictness strictness) |
| 66 | { |
| 67 | PgXmlErrorContext *xmlerrcxt; |
| 68 | |
| 69 | /* Set up error handling (we share the core's error handler) */ |
| 70 | xmlerrcxt = pg_xml_init(strictness); |
| 71 | |
| 72 | /* Note: we're assuming an elog cannot be thrown by the following calls */ |
| 73 | |
| 74 | /* Initialize libxml */ |
| 75 | xmlInitParser(); |
| 76 | |
| 77 | xmlSubstituteEntitiesDefault(1); |
| 78 | xmlLoadExtDtdDefaultValue = 1; |
| 79 | |
| 80 | return xmlerrcxt; |
| 81 | } |
| 82 | |
| 83 | |
| 84 | /* |
no test coverage detected