SpatiaLite 4.3.0a
Defines | Functions

src/headers/spatialite/gg_xml.h File Reference

Geometry handling functions: XML document. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GAIA_XML_START   0x00
 XmlBLOB internal marker: START.
#define GAIA_XML_END   0xDD
 XmlBLOB internal marker: END.
#define GAIA_XML_HEADER   0xAC
 XmlBLOB internal marker: HEADER.
#define GAIA_XML_LEGACY_HEADER   0xAB
 XmlBLOB internal marker: LEGACY HEADER.
#define GAIA_XML_SCHEMA   0xBA
 XmlBLOB internal marker: SCHEMA.
#define GAIA_XML_FILEID   0xCA
 XmlBLOB internal marker: FILEID.
#define GAIA_XML_PARENTID   0xDA
 XmlBLOB internal marker: PARENTID.
#define GAIA_XML_NAME   0xDE
 XmlBLOB internal marker: TITLE.
#define GAIA_XML_TITLE   0xDB
 XmlBLOB internal marker: TITLE.
#define GAIA_XML_ABSTRACT   0xDC
 XmlBLOB internal marker: ABSTRACT.
#define GAIA_XML_GEOMETRY   0xDD
 XmlBLOB internal marker: GEOMETRY.
#define GAIA_XML_CRC32   0xBC
 XmlBLOB internal marker: CRC32.
#define GAIA_XML_PAYLOAD   0xCB
 XmlBLOB internal marker: PAYLOAD.
#define GAIA_XML_LITTLE_ENDIAN   0x01
 XmlBLOB FLAG - LITTLE_ENDIAN bitmask.
#define GAIA_XML_COMPRESSED   0x02
 XmlBLOB FLAG - COMPRESSED bitmask.
#define GAIA_XML_VALIDATED   0x04
 XmlBLOB FLAG - VALIDATED bitmask.
#define GAIA_XML_ISO_METADATA   0x80
 XmlBLOB FLAG - ISO METADATA bitmask.
#define GAIA_XML_SLD_SE_RASTER_STYLE   0x10
 XmlBLOB FLAG - SLDSE VECTOR STYLE bitmask.
#define GAIA_XML_SLD_SE_VECTOR_STYLE   0x40
 XmlBLOB FLAG - SLDSE VECTOR STYLE bitmask.
#define GAIA_XML_SLD_STYLE   0x48
 XmlBLOB FLAG - SLD STYLE bitmask.
#define GAIA_XML_SVG   0x20
 XmlBLOB FLAG - SVG bitmask.

Functions

GAIAGEO_DECLARE char * gaia_libxml2_version (void)
 return the LIBXML2 version string
GAIAGEO_DECLARE void gaiaXmlToBlob (const void *p_cache, const unsigned char *xml, int xml_len, int compressed, const char *schemaURI, unsigned char **result, int *size, char **parsing_errors, char **schema_validation_errors)
 Creates an XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlTextFromBlob (const unsigned char *blob, int size, int indent)
 Extract an XMLDocument from within an XmlBLOB buffer.
GAIAGEO_DECLARE void gaiaXmlFromBlob (const unsigned char *blob, int size, int indent, unsigned char **result, int *res_size)
 Extract an XMLDocument from within an XmlBLOB buffer.
GAIAGEO_DECLARE int gaiaIsValidXmlBlob (const unsigned char *blob, int size)
 Checks if a BLOB actually is a valid XmlBLOB buffer.
GAIAGEO_DECLARE int gaiaIsCompressedXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer is compressed or not.
GAIAGEO_DECLARE int gaiaIsIsoMetadataXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer does contain an ISO Metadata or not.
GAIAGEO_DECLARE int gaiaIsSldSeVectorStyleXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not.
GAIAGEO_DECLARE int gaiaIsSldSeRasterStyleXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not.
GAIAGEO_DECLARE int gaiaIsSldStyleXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer does contain an SLD Style or not.
GAIAGEO_DECLARE int gaiaIsSvgXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer does contain an SVG Symbol or not.
GAIAGEO_DECLARE void gaiaXmlBlobCompression (const unsigned char *blob, int in_size, int compressed, unsigned char **result, int *out_size)
 Return another XmlBLOB buffer compressed / uncompressed.
GAIAGEO_DECLARE int gaiaIsSchemaValidatedXmlBlob (const unsigned char *blob, int size)
 Checks if a valid XmlBLOB buffer has successfully passed a formal Schema validation or not.
GAIAGEO_DECLARE int gaiaXmlBlobGetDocumentSize (const unsigned char *blob, int size)
 Return the XMLDocument size (in bytes) from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetSchemaURI (const unsigned char *blob, int size)
 Return the SchemaURI from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlGetInternalSchemaURI (const void *p_cache, const unsigned char *xml, int xml_len)
 Return the Internal SchemaURI from a valid XmlDocument.
GAIAGEO_DECLARE char * gaiaXmlBlobGetFileId (const unsigned char *blob, int size)
 Return the FileIdentifier from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetParentId (const unsigned char *blob, int size)
 Return the ParentIdentifier from a valid XmlBLOB buffer.
GAIAGEO_DECLARE int gaiaXmlBlobSetFileId (const void *p_cache, const unsigned char *blob, int size, const char *identifier, unsigned char **new_blob, int *new_size)
 Return a new XmlBLOB (ISO Metadata) by replacing the FileId value.
GAIAGEO_DECLARE int gaiaXmlBlobSetParentId (const void *p_cache, const unsigned char *blob, int size, const char *identifier, unsigned char **new_blob, int *new_size)
 Return a new XmlBLOB (ISO Metadata) by replacing the ParentId value.
GAIAGEO_DECLARE int gaiaXmlBlobAddFileId (const void *p_cache, const unsigned char *blob, int size, const char *identifier, const char *ns_id, const char *uri_id, const char *ns_charstr, const char *uri_charstr, unsigned char **new_blob, int *new_size)
 Return a new XmlBLOB (ISO Metadata) by inserting a FileId value.
GAIAGEO_DECLARE int gaiaXmlBlobAddParentId (const void *p_cache, const unsigned char *blob, int size, const char *identifier, const char *ns_id, const char *uri_id, const char *ns_charstr, const char *uri_charstr, unsigned char **new_blob, int *new_size)
 Return a new XmlBLOB (ISO Metadata) by inserting a ParentId value.
GAIAGEO_DECLARE char * gaiaXmlBlobGetName (const unsigned char *blob, int size)
 Return the Name from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetTitle (const unsigned char *blob, int size)
 Return the Title from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetAbstract (const unsigned char *blob, int size)
 Return the Abstract from a valid XmlBLOB buffer.
GAIAGEO_DECLARE void gaiaXmlBlobGetGeometry (const unsigned char *blob, int size, unsigned char **blob_geom, int *blob_size)
 Return the Geometry Buffer from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetEncoding (const unsigned char *blob, int size)
 Return the Charset Encoding from a valid XmlBLOB buffer.
GAIAGEO_DECLARE char * gaiaXmlBlobGetLastParseError (const void *p_cache)
 Return the most recent XML Parse error/warning (if any)
GAIAGEO_DECLARE char * gaiaXmlBlobGetLastValidateError (const void *p_cache)
 Return the most recent XML Validate error/warning (if any)
GAIAGEO_DECLARE int gaiaIsValidXPathExpression (const void *p_cache, const char *xpath_expr)
 Checks if a Text string could be a valid XPathExpression.
GAIAGEO_DECLARE char * gaiaXmlBlobGetLastXPathError (const void *p_cache)
 Return the most recent XPath error/warning (if any)
GAIAGEO_DECLARE int gaiaXmlLoad (const void *p_cache, const char *path_or_url, unsigned char **result, int *size, char **parsing_errors)
 Load an external XML Document.
GAIAGEO_DECLARE int gaiaXmlStore (const unsigned char *blob, int size, const char *path, int indent)
 Stores an external XML Document.

Detailed Description

Geometry handling functions: XML document.


Function Documentation

GAIAGEO_DECLARE char* gaia_libxml2_version ( void  )

return the LIBXML2 version string

Returns:
a text string identifying the current LIBXML2 version
Note:
the version string corresponds to dynamically allocated memory: so you are responsible to free() it [unless SQLite will take care of memory cleanup via buffer binding].
GAIAGEO_DECLARE int gaiaIsCompressedXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer is compressed or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsIsoMetadataXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer does contain an ISO Metadata or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsSchemaValidatedXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer has successfully passed a formal Schema validation or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB but not schema-validated; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSvgXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob
GAIAGEO_DECLARE int gaiaIsSldSeRasterStyleXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the Raster type; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsSldSeVectorStyleXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the Vector type; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsSldStyleXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer does contain an SLD Style or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the SLD type; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsSvgXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a valid XmlBLOB buffer does contain an SVG Symbol or not.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.
See also:
gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob
GAIAGEO_DECLARE int gaiaIsValidXmlBlob ( const unsigned char *  blob,
int  size 
)

Checks if a BLOB actually is a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
TRUE or FALSE
See also:
gaiaIsCompressedXmlBlob, gaiaIsSchemaValidatedXmlBlob, gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob, gaiaIsSvgXmlBlob
GAIAGEO_DECLARE int gaiaIsValidXPathExpression ( const void *  p_cache,
const char *  xpath_expr 
)

Checks if a Text string could be a valid XPathExpression.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
xpath_exprpointer to the XPathExpression to be checked.
Returns:
TRUE or FALSE if the Text string actually is a valid XPathExpression; -1 in any other case.
See also:
gaiaXmlBlobGetLastXPathError
GAIAGEO_DECLARE int gaiaXmlBlobAddFileId ( const void *  p_cache,
const unsigned char *  blob,
int  size,
const char *  identifier,
const char *  ns_id,
const char *  uri_id,
const char *  ns_charstr,
const char *  uri_charstr,
unsigned char **  new_blob,
int *  new_size 
)

Return a new XmlBLOB (ISO Metadata) by inserting a FileId value.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
blobpointer to the input XmlBLOB buffer.
sizeinput XmlBLOB's size (in bytes).
identifierthe new FileId value to be inserted.
ns_idprefix corresponding to FileIdentifier NameSpace (may be NULL)
uri_idURI corresponding to the FileIdentifier NameSpace (may be NULL)
ns_charstrprefix corresponding to CharacterString NameSpace (may be NULL)
uri_charstrURI corresponding to CharacterString NameSpace (may be NULL)
new_blobon completion will contain a pointer to the output XmlBLOB buffer.
new_sizeon completion will containg the output XmlBlob's size (in bytes).
Returns:
TRUE for success; FALSE for any failure cause.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobGetFileId, gaiaXmlBlobSetFileId
Note:
the output XmlBLOB corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE int gaiaXmlBlobAddParentId ( const void *  p_cache,
const unsigned char *  blob,
int  size,
const char *  identifier,
const char *  ns_id,
const char *  uri_id,
const char *  ns_charstr,
const char *  uri_charstr,
unsigned char **  new_blob,
int *  new_size 
)

Return a new XmlBLOB (ISO Metadata) by inserting a ParentId value.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
blobpointer to the inputXmlBLOB buffer.
sizeinput XmlBLOB's size (in bytes).
identifierthe new ParentId value to be inserted.
ns_idprefix corresponding to FileIdentifier NameSpace (may be NULL)
uri_idURI corresponding to the FileIdentifier NameSpace (may be NULL)
ns_charstrprefix corresponding to CharacterString NameSpace (may be NULL)
uri_charstrURI corresponding to CharacterString NameSpace (may be NULL)
new_blobon completion will contain a pointer to the output XmlBLOB buffer.
new_sizeon completion will containg the output XmlBlob's size (in bytes).
Returns:
TRUE for success; FALSE for any failure cause.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobGetParentId, gaiaXmlBlobSetParentId
Note:
the returned XmlBLOB corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE void gaiaXmlBlobCompression ( const unsigned char *  blob,
int  in_size,
int  compressed,
unsigned char **  result,
int *  out_size 
)

Return another XmlBLOB buffer compressed / uncompressed.

Parameters:
blobpointer to the input XmlBLOB buffer.
in_sizeinput XmlBLOB's size (in bytes).
compressedif TRUE the returned XmlBLOB will be zip-compressed.
resulton completion will containt a pointer to the output XmlBLOB: NULL on failure.
out_sizeon completion this variable will contain the output XmlBLOB's size (in bytes)
See also:
gaiaXmlToBlob, gaiaIsCompressedXmlBlob
Note:
the XmlBLOB buffer corresponds to dynamically allocated memory: so you are responsible to free() it [unless SQLite will take care of memory cleanup via buffer binding].
GAIAGEO_DECLARE char* gaiaXmlBlobGetAbstract ( const unsigned char *  blob,
int  size 
)

Return the Abstract from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the Abstract for any valid XmlBLOB containing an Abstract; NULL in any other case.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob
Note:
the returned Abstract corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE int gaiaXmlBlobGetDocumentSize ( const unsigned char *  blob,
int  size 
)

Return the XMLDocument size (in bytes) from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the XMLDocument size (in bytes) for any valid XmlBLOB; -1 if the BLOB isn't a valid XmlBLOB.
GAIAGEO_DECLARE char* gaiaXmlBlobGetEncoding ( const unsigned char *  blob,
int  size 
)

Return the Charset Encoding from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the Charset Encoding for any valid XmlBLOB explicitly defining an Encoding; NULL in any other case.
Note:
the returned Encoding corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetFileId ( const unsigned char *  blob,
int  size 
)

Return the FileIdentifier from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the FileIdentifier for any valid XmlBLOB containing a FileIdentifier; NULL in any other case.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobSetFileId, gaiaXmlBlobAddFileId
Note:
the returned FileIdentifier corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE void gaiaXmlBlobGetGeometry ( const unsigned char *  blob,
int  size,
unsigned char **  blob_geom,
int *  blob_size 
)

Return the Geometry Buffer from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
blob_geomon completion this variable will contain a pointer to the returned Geometry Buffer (NULL if no Geometry was defined within the XmlBLOB)
blob_sizeon completion this variable will contain the size (in bytes) of the returned Geometry Buffer
See also:
gaiaIsIsoMetadataXmlBlob
Note:
the returned Geometry Buffer corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetLastParseError ( const void *  p_cache)

Return the most recent XML Parse error/warning (if any)

Parameters:
ptra memory pointer returned by spatialite_alloc_connection()
Returns:
the most recent XML Parse error/warning message (if any); NULL in any other case.
See also:
gaiaXmlBlobGetLastValidateError, gaiaIsValidXPathExpression, gaiaXmlBlobGetLastXPathError
Note:
the returned error/warning message corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetLastValidateError ( const void *  p_cache)

Return the most recent XML Validate error/warning (if any)

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
Returns:
the most recent XML Validate error/warning message (if any); NULL in any other case.
See also:
gaiaXmlBlobGetLastParseError, gaiaIsValidXPathExpression, gaiaXmlBlobGetLastXPathError
Note:
the returned error/warning message corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetLastXPathError ( const void *  p_cache)

Return the most recent XPath error/warning (if any)

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
Returns:
the most recent XPath error/warning message (if any); NULL in any other case.
See also:
gaiaXmlBlobGetLastParseError, gaiaXmlBlobGetLastValidateError, gaiaIsValidXPathExpression
Note:
the returned error/warning message corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetName ( const unsigned char *  blob,
int  size 
)

Return the Name from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the Name for any valid XmlBLOB containing a Name; NULL in any other case.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob
Note:
the returned Name corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetParentId ( const unsigned char *  blob,
int  size 
)

Return the ParentIdentifier from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the ParentIdentifier for any valid XmlBLOB containing a ParentIdentifier; NULL in any other case.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobSetParentId, gaiaXmlBlobAddParentId
Note:
the returned ParentIdentifier corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetSchemaURI ( const unsigned char *  blob,
int  size 
)

Return the SchemaURI from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the SchemaURI for any valid XmlBLOB containing a SchemaURI; NULL in any other case.
See also:
gaiaXmlGetInternalSchemaURI
Note:
the returned SchemaURI corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlBlobGetTitle ( const unsigned char *  blob,
int  size 
)

Return the Title from a valid XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
Returns:
the Title for any valid XmlBLOB containing a Title; NULL in any other case.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob
Note:
the returned Title corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE int gaiaXmlBlobSetFileId ( const void *  p_cache,
const unsigned char *  blob,
int  size,
const char *  identifier,
unsigned char **  new_blob,
int *  new_size 
)

Return a new XmlBLOB (ISO Metadata) by replacing the FileId value.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
blobpointer to the input XmlBLOB buffer.
sizeinput XmlBLOB's size (in bytes).
identifierthe new FileId value to be set.
new_blobon completion will contain a pointer to the output XmlBLOB buffer.
new_sizeon completion will containg the output XmlBlob's size (in bytes).
Returns:
TRUE for success; FALSE for any failure cause.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobGetFileId, gaiaXmlBlobAddFileId
Note:
the output XmlBLOB corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE int gaiaXmlBlobSetParentId ( const void *  p_cache,
const unsigned char *  blob,
int  size,
const char *  identifier,
unsigned char **  new_blob,
int *  new_size 
)

Return a new XmlBLOB (ISO Metadata) by replacing the ParentId value.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
blobpointer to the inputXmlBLOB buffer.
sizeinput XmlBLOB's size (in bytes).
identifierthe new ParentId value to be set.
new_blobon completion will contain a pointer to the output XmlBLOB buffer.
new_sizeon completion will containg the output XmlBlob's size (in bytes).
Returns:
TRUE for success; FALSE for any failure cause.
See also:
gaiaIsIsoMetadataXmlBlob, gaiaXmlBlobGetParentId, gaiaXmlBlobAddParentId
Note:
the returned XmlBLOB corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE void gaiaXmlFromBlob ( const unsigned char *  blob,
int  size,
int  indent,
unsigned char **  result,
int *  res_size 
)

Extract an XMLDocument from within an XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
indentif a negative value is passed the XMLDocument will be extracted exactly as it was when loaded. Otherwise it will be properly formatted using the required intenting (max. 8); ZERO means that the whole XML Document will consist of a single line.
resultpointer to the memory buffer containing the XML Document
res_sizedimension (in bytes) of the XML Document memory buffer (both values will be passed back after successful completion).
See also:
gaiaXmlToBlob, gaiaXmlTextFromBlob
Note:
the returned XMLDocument will always respect the internal encoding declaration, and may not support any further processing as SQLite TEXT if it's not UTF-8.
the XMLDocument buffer corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE char* gaiaXmlGetInternalSchemaURI ( const void *  p_cache,
const unsigned char *  xml,
int  xml_len 
)

Return the Internal SchemaURI from a valid XmlDocument.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
xmlpointer to the XML document
xml_lenlenght of the XML document (in bytes).
Returns:
the SchemaURI eventually defined within a valid XMLDocument; NULL if the XMLDocument is invalid, or if it doesn't contain any SchemaURI.
See also:
gaiaXmlBlobGetSchemaURI
Note:
the returned SchemaURI corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE int gaiaXmlLoad ( const void *  p_cache,
const char *  path_or_url,
unsigned char **  result,
int *  size,
char **  parsing_errors 
)

Load an external XML Document.

Parameters:
path_or_urlpointer to the external XML Document (could be a pathname or an URL).
resulton completion will containt a pointer to a BLOB: NULL on failure.
sizeon completion this variable will contain the BLOB's size (in bytes).
parsing_errorson completion this variable will contain all error/warning messages emitted during the XML Parsing step. Can be set to NULL so to ignore any message.
See also:
gaiaXmlFromBlob, gaiaXmlStore
Note:
the BLOB buffer corresponds to dynamically allocated memory: so you are responsible to free() it [unless SQLite will take care of memory cleanup via buffer binding].
GAIAGEO_DECLARE int gaiaXmlStore ( const unsigned char *  blob,
int  size,
const char *  path,
int  indent 
)

Stores an external XML Document.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
pathpathname of the export file
indentif a negative value is passed the XMLDocument will be extracted exactly as it was when loaded. Otherwise it will be properly formatted using the required intenting (max. 8); ZERO means that the whole XML Document will consist of a single line.
See also:
gaiaXmlToBlob, gaiaXmlTextFromBlob
Note:
the returned XMLDocument will always respect the internal encoding declaration, and may not support any further processing as SQLite TEXT if it's not UTF-8.
the XMLDocument buffer corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
See also:
gaiaXmlFromBlob, gaiaXmlLoad
Note:
the BLOB buffer corresponds to dynamically allocated memory: so you are responsible to free() it [unless SQLite will take care of memory cleanup via buffer binding].
GAIAGEO_DECLARE char* gaiaXmlTextFromBlob ( const unsigned char *  blob,
int  size,
int  indent 
)

Extract an XMLDocument from within an XmlBLOB buffer.

Parameters:
blobpointer to the XmlBLOB buffer.
sizeXmlBLOB's size (in bytes).
indentif a negative value is passed the XMLDocument will be extracted exactly as it was when loaded. Otherwise it will be properly formatted using the required intenting (max. 8); ZERO means that the whole XML Document will consist of a single line.
Returns:
the pointer to the newly created XMLDocument buffer: NULL on failure
See also:
gaiaXmlToBlob, gaiaXmlFromBlob
Note:
the returned XMLDocument will always be encoded as UTF-8 (irrespectively from the internal encoding declaration), so to allow any further processing as SQLite TEXT.
the XMLDocument buffer corresponds to dynamically allocated memory: so you are responsible to free() it before or after.
GAIAGEO_DECLARE void gaiaXmlToBlob ( const void *  p_cache,
const unsigned char *  xml,
int  xml_len,
int  compressed,
const char *  schemaURI,
unsigned char **  result,
int *  size,
char **  parsing_errors,
char **  schema_validation_errors 
)

Creates an XmlBLOB buffer.

Parameters:
p_cachea memory pointer returned by spatialite_alloc_connection()
xmlpointer to the XML document (XmlBLOB payload).
xml_lenlenght of the XML document (in bytes).
compressedif TRUE the returned XmlBLOB will be zip-compressed.
schemaURIif not NULL the XML document will be assumed to be valid only if it successfully passes a formal Schema valitadion.
resulton completion will containt a pointer to XmlBLOB: NULL on failure.
sizeon completion this variable will contain the XmlBLOB's size (in bytes)
parsing_errorson completion this variable will contain all error/warning messages emitted during the XML Parsing step. Can be set to NULL so to ignore any message.
schema_validation_errorson completion this variable will contain all error/warning messages emitted during the XML Schema Validation step. Can be set to NULL so to ignore any message.
See also:
gaiaXmlFromBlob, gaiaXmlTextFromBlob, gaiaXmlBlobGetLastParseError, gaiaXmlBlobGetLastValidateError
Note:
the XmlBLOB buffer corresponds to dynamically allocated memory: so you are responsible to free() it [unless SQLite will take care of memory cleanup via buffer binding].
 All Data Structures Files Functions Variables Typedefs Defines