2006-12-21 17:05:16 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* xml.h
|
|
|
|
* Declarations for XML data type support.
|
|
|
|
*
|
|
|
|
*
|
2008-01-01 20:46:01 +01:00
|
|
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
2006-12-21 17:05:16 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2008-04-04 10:33:15 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.24 2008/04/04 08:33:15 mha Exp $
|
2006-12-21 17:05:16 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef XML_H
|
|
|
|
#define XML_H
|
|
|
|
|
|
|
|
#include "fmgr.h"
|
2007-01-10 21:33:54 +01:00
|
|
|
#include "nodes/execnodes.h"
|
2007-02-03 15:06:56 +01:00
|
|
|
#include "nodes/primnodes.h"
|
2006-12-21 17:05:16 +01:00
|
|
|
|
|
|
|
typedef struct varlena xmltype;
|
|
|
|
|
|
|
|
#define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X))
|
2007-02-03 15:06:56 +01:00
|
|
|
#define XmlPGetDatum(X) PointerGetDatum(X)
|
2006-12-21 17:05:16 +01:00
|
|
|
|
|
|
|
#define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n))
|
|
|
|
#define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x)
|
|
|
|
|
|
|
|
extern Datum xml_in(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum xml_out(PG_FUNCTION_ARGS);
|
2006-12-28 15:28:36 +01:00
|
|
|
extern Datum xml_recv(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum xml_send(PG_FUNCTION_ARGS);
|
2006-12-21 17:05:16 +01:00
|
|
|
extern Datum xmlcomment(PG_FUNCTION_ARGS);
|
2007-01-20 10:27:20 +01:00
|
|
|
extern Datum xmlconcat2(PG_FUNCTION_ARGS);
|
2006-12-24 01:29:20 +01:00
|
|
|
extern Datum texttoxml(PG_FUNCTION_ARGS);
|
2007-02-03 15:06:56 +01:00
|
|
|
extern Datum xmltotext(PG_FUNCTION_ARGS);
|
2006-12-21 17:05:16 +01:00
|
|
|
extern Datum xmlvalidate(PG_FUNCTION_ARGS);
|
2007-05-21 19:10:29 +02:00
|
|
|
extern Datum xpath(PG_FUNCTION_ARGS);
|
2006-12-21 17:05:16 +01:00
|
|
|
|
2007-02-16 08:46:55 +01:00
|
|
|
extern Datum table_to_xml(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum query_to_xml(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cursor_to_xml(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum table_to_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum query_to_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
|
2007-04-01 11:00:26 +02:00
|
|
|
|
|
|
|
extern Datum schema_to_xml(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
extern Datum database_to_xml(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum database_to_xmlschema(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
|
2007-02-16 08:46:55 +01:00
|
|
|
|
2007-01-25 12:53:52 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
XML_STANDALONE_YES,
|
|
|
|
XML_STANDALONE_NO,
|
|
|
|
XML_STANDALONE_NO_VALUE,
|
|
|
|
XML_STANDALONE_OMITTED
|
2007-11-15 23:25:18 +01:00
|
|
|
} XmlStandaloneType;
|
2007-01-25 12:53:52 +01:00
|
|
|
|
2007-01-20 10:27:20 +01:00
|
|
|
extern xmltype *xmlconcat(List *args);
|
2007-11-15 23:25:18 +01:00
|
|
|
extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext);
|
2007-02-03 15:06:56 +01:00
|
|
|
extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
|
2007-01-07 23:49:56 +01:00
|
|
|
extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null);
|
2007-11-15 23:25:18 +01:00
|
|
|
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
|
|
|
|
extern bool xml_is_document(xmltype *arg);
|
|
|
|
extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg);
|
2006-12-24 01:29:20 +01:00
|
|
|
|
2007-02-11 23:18:16 +01:00
|
|
|
extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, bool escape_period);
|
2006-12-29 11:50:22 +01:00
|
|
|
extern char *map_xml_name_to_sql_identifier(char *name);
|
2007-01-12 22:47:27 +01:00
|
|
|
extern char *map_sql_value_to_xml_value(Datum value, Oid type);
|
2006-12-21 17:05:16 +01:00
|
|
|
|
2008-01-15 19:57:00 +01:00
|
|
|
extern void AtEOXact_xml(void);
|
|
|
|
|
2007-01-19 17:58:46 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
XMLBINARY_BASE64,
|
|
|
|
XMLBINARY_HEX
|
2007-11-15 23:25:18 +01:00
|
|
|
} XmlBinaryType;
|
2007-01-19 17:58:46 +01:00
|
|
|
|
2008-04-04 10:33:15 +02:00
|
|
|
extern int xmlbinary; /* XmlBinaryType, but int for guc enum */
|
2007-01-19 17:58:46 +01:00
|
|
|
|
2008-04-04 10:33:15 +02:00
|
|
|
extern int xmloption; /* XmlOptionType, but int for guc enum */
|
2007-01-25 12:53:52 +01:00
|
|
|
|
2007-11-15 22:14:46 +01:00
|
|
|
#endif /* XML_H */
|