1
/*-------------------------------------------------------------------------
4
* Declarations for XML data type support.
7
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* src/include/utils/xml.h
12
*-------------------------------------------------------------------------
19
#include "nodes/execnodes.h"
20
#include "nodes/primnodes.h"
22
typedef struct varlena xmltype;
24
#define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X))
25
#define XmlPGetDatum(X) PointerGetDatum(X)
27
#define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n))
28
#define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x)
30
extern Datum xml_in(PG_FUNCTION_ARGS);
31
extern Datum xml_out(PG_FUNCTION_ARGS);
32
extern Datum xml_recv(PG_FUNCTION_ARGS);
33
extern Datum xml_send(PG_FUNCTION_ARGS);
34
extern Datum xmlcomment(PG_FUNCTION_ARGS);
35
extern Datum xmlconcat2(PG_FUNCTION_ARGS);
36
extern Datum texttoxml(PG_FUNCTION_ARGS);
37
extern Datum xmltotext(PG_FUNCTION_ARGS);
38
extern Datum xmlvalidate(PG_FUNCTION_ARGS);
39
extern Datum xpath(PG_FUNCTION_ARGS);
40
extern Datum xpath_exists(PG_FUNCTION_ARGS);
41
extern Datum xmlexists(PG_FUNCTION_ARGS);
42
extern Datum xml_is_well_formed(PG_FUNCTION_ARGS);
43
extern Datum xml_is_well_formed_document(PG_FUNCTION_ARGS);
44
extern Datum xml_is_well_formed_content(PG_FUNCTION_ARGS);
46
extern Datum table_to_xml(PG_FUNCTION_ARGS);
47
extern Datum query_to_xml(PG_FUNCTION_ARGS);
48
extern Datum cursor_to_xml(PG_FUNCTION_ARGS);
49
extern Datum table_to_xmlschema(PG_FUNCTION_ARGS);
50
extern Datum query_to_xmlschema(PG_FUNCTION_ARGS);
51
extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS);
52
extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
53
extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
55
extern Datum schema_to_xml(PG_FUNCTION_ARGS);
56
extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS);
57
extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
59
extern Datum database_to_xml(PG_FUNCTION_ARGS);
60
extern Datum database_to_xmlschema(PG_FUNCTION_ARGS);
61
extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
67
XML_STANDALONE_NO_VALUE,
68
XML_STANDALONE_OMITTED
71
extern void pg_xml_init(void);
72
extern void xml_ereport(int level, int sqlcode, const char *msg);
73
extern xmltype *xmlconcat(List *args);
74
extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext);
75
extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
76
extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null);
77
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
78
extern bool xml_is_document(xmltype *arg);
79
extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg);
80
extern char *escape_xml(const char *str);
82
extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, bool escape_period);
83
extern char *map_xml_name_to_sql_identifier(char *name);
84
extern char *map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings);
92
extern int xmlbinary; /* XmlBinaryType, but int for guc enum */
94
extern int xmloption; /* XmlOptionType, but int for guc enum */