GdomeDOMImplementation

Name

GdomeDOMImplementation -- Interface DOMImplementation implementation.

Synopsis



struct      GdomeDOMImplementation;
GdomeDOMImplementation* gdome_di_mkref      (void);
void        gdome_di_ref                    (GdomeDOMImplementation *self,
                                             GdomeException *exc);
void        gdome_di_unref                  (GdomeDOMImplementation *self,
                                             GdomeException *exc);
gpointer    gdome_di_query_interface        (GdomeDOMImplementation *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeBoolean gdome_di_hasFeature            (GdomeDOMImplementation *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDocumentType* gdome_di_createDocumentType
                                            (GdomeDOMImplementation *self,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *publicId,
                                             GdomeDOMString *systemId,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocument      (GdomeDOMImplementation *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDocumentType *doctype,
                                             GdomeException *exc);
void        gdome_di_freeDoc                (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromURI    (GdomeDOMImplementation *self,
                                             const char *uri,
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromMemory (GdomeDOMImplementation *self,
                                             char *buffer,
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromURIWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             const char *uri,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromMemoryWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             char *buffer,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToFile         (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToFileEnc      (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToMemory       (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToMemoryEnc    (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Description

The GdomeDOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.

Details

struct GdomeDOMImplementation

struct GdomeDOMImplementation {
	gpointer user_data;
};


gdome_di_mkref ()

GdomeDOMImplementation* gdome_di_mkref      (void);

Constructor of the DOMImplementation interface.

Returns : the reference to the DOMImplementation structure.


gdome_di_ref ()

void        gdome_di_ref                    (GdomeDOMImplementation *self,
                                             GdomeException *exc);

Increase the reference count of the DOMImplementation structure.

self : DOMImplementation Object ref
exc : Exception Object ref


gdome_di_unref ()

void        gdome_di_unref                  (GdomeDOMImplementation *self,
                                             GdomeException *exc);

Decrease the reference count of the DOMImplementation. Free the structure if DOMImplementation will have zero reference.

self : DOMImplementation Object ref
exc : Exception Object ref


gdome_di_query_interface ()

gpointer    gdome_di_query_interface        (GdomeDOMImplementation *self,
                                             const char *interface,
                                             GdomeException *exc);

self : DOMImplementation Object ref
interface : interface needed
exc : Exception Object ref
Returns : a reference to this object that implements the interface needed, or NULL if the interface is not supported by this Object.


gdome_di_hasFeature ()

GdomeBoolean gdome_di_hasFeature            (GdomeDOMImplementation *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);

Tests whether the DOM implementation implements a specific feature.

self : The DOMImplementation Object ref
feature : The name of the feature to test (case-insensitive).
version : This is the version number of the feature to test. In Level 2, version 1, this is the string "2.0". If the version is not specified, supporting any version of the feature will cause the method to return TRUE.
exc : Exception Object ref
Returns : TRUE if the feature is supported, FALSE otherwise.


gdome_di_createDocumentType ()

GdomeDocumentType* gdome_di_createDocumentType
                                            (GdomeDOMImplementation *self,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *publicId,
                                             GdomeDOMString *systemId,
                                             GdomeException *exc);

Creates an empty DocumentType node. Entity declarations and notations are not made available. Entity reference expansions and default attribute additions do not occur. It is expected that a future version of the DOM will provide a way for populating a DocumentType.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed.

self : The DOMImplementation Object ref
qualifiedName : The qualified name of the document type to be created
publicId : The external subset public identifier
systemId : The external subset system identifier
exc : The Exception Object ref
Returns : A new DocumentType node.


gdome_di_createDocument ()

GdomeDocument* gdome_di_createDocument      (GdomeDOMImplementation *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDocumentType *doctype,
                                             GdomeException *exc);

Creates an XML Document object of the specified type with its document element.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is NULL, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" GDOME_WRONG_DOCUMENT_ERR: Raised if doctype has already been used with a different document.

self : DOMImplementation Object ref
namespaceURI : The namespace URI of the document element to create
qualifiedName : The qualified name of the document element to be created
doctype : The type of document to be created or NULL
exc : Exception Object ref
Returns : a new Document node.


gdome_di_freeDoc ()

void        gdome_di_freeDoc                (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             GdomeException *exc);

DEPRECATED! Free all objects and structures associated to the Document specified.

self : DOMImplementation Object ref
doc : The Document Object ref to be freed
exc : Exception Object ref


gdome_di_createDocFromURI ()

GdomeDocument* gdome_di_createDocFromURI    (GdomeDOMImplementation *self,
                                             const char *uri,
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document from a URI and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.

self : DOMImplementation Object ref
uri : the uri of XML file to load
mode : specifies if the document is to be parsed, validated or recovered and if the entity substitution has to be done.
exc : Exception Object ref
Returns : The Document Object of the created tree or NULL if an error occur.


gdome_di_createDocFromMemory ()

GdomeDocument* gdome_di_createDocFromMemory (GdomeDOMImplementation *self,
                                             char *buffer,
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document from a memory buffer and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.

self : DOMImplementation Object ref
buffer : a pointer to char array that holds the XML document
mode : specifies if the document is to be parsed, validated or recovered and if the entity substitution has to be done.
exc : Exception Object ref
Returns : The Document Object of the created tree or NULL if an error occur.


gdome_di_createDocFromURIWithEntitiesTable ()

GdomeDocument* gdome_di_createDocFromURIWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             const char *uri,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document using also entity declaration specified in entityTable from a URI and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.

self : DOMImplementation Object ref
uri : the uri of XML file to load
entityTable : array of GdomeEntitiesTableEntry that define name, value, publicID ans systemID of entities used but not declared in DTD. The array must be NULL terminated.
mode : specifies if the document is to be parsed, validated or recovered and if the entity substitution has to be done.
exc : Exception Object ref
Returns : The Document Object of the created tree or NULL if an error occur.


gdome_di_createDocFromMemoryWithEntitiesTable ()

GdomeDocument* gdome_di_createDocFromMemoryWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             char *buffer,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document using also entity declaration specified in entityTable from a memory buffer and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.

self : DOMImplementation Object ref
buffer : a pointer to char array that holds the XML document
entityTable : array of GdomeEntitiesTableEntry that define name, value, publicID ans systemID of entities used but not declared in DTD. The array must be NULL terminated.
mode : specifies if the document is to be parsed, validated or recovered and if the entity substitution has to be done.
exc : Exception Object ref
Returns : The Document Object of the created tree or NULL if an error occur.


gdome_di_saveDocToFile ()

GdomeBoolean gdome_di_saveDocToFile         (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Save the DOM tree of the Document specified to file.

self : DOMImplementation Object ref
doc : the Document of which the tree is wanted to be saved
filename : the XML filename to save
mode : the indentation mode wanted
exc : Exception Object ref
Returns : FALSE in case of failure, TRUE otherwise.


gdome_di_saveDocToFileEnc ()

GdomeBoolean gdome_di_saveDocToFileEnc      (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Save the DOM tree of the Document specified to file with the specified Character encoding.

self : DOMImplementation Object ref
doc : the Document of which the tree is wanted to be saved
filename : the XML filename to save
encoding : character encoding to use when generating XML text
mode : the indentation mode wanted
exc : Exception Object ref
Returns : FALSE in case of failure, TRUE otherwise.


gdome_di_saveDocToMemory ()

GdomeBoolean gdome_di_saveDocToMemory       (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Save the DOM tree of the Document specified to a new allocated memory and return it in the mem pointer.

self : DOMImplementation Object ref
doc : the Document of which the tree is wanted to be saved
mem : the memory pointer where the saved document is returned
mode : the indentation mode wanted
exc : Exception Object ref
Returns : FALSE in case of failure, TRUE otherwise.


gdome_di_saveDocToMemoryEnc ()

GdomeBoolean gdome_di_saveDocToMemoryEnc    (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Save the DOM tree of the Document specified using the specified character encoding standard to a new allocated memory and return it in the mem pointer.

self : DOMImplementation Object ref
doc : the Document of which the tree is wanted to be saved
mem : the memory pointer where the saved document is returned
encoding : character encoding to use when generating XML text
mode : the indentation mode wanted
exc : Exception Object ref
Returns : FALSE in case of failure, TRUE otherwise.