libdom
Loading...
Searching...
No Matches
implementation.h File Reference
#include <stdbool.h>
#include <dom/core/exceptions.h>
#include <dom/events/document_event.h>
#include <dom/functypes.h>

Go to the source code of this file.

Typedefs

typedef const char dom_implementation
 
typedef enum dom_implementation_type dom_implementation_type
 

Enumerations

enum  dom_implementation_type { DOM_IMPLEMENTATION_CORE = 0 , DOM_IMPLEMENTATION_XML = (1 << 0) , DOM_IMPLEMENTATION_HTML = (1 << 1) , DOM_IMPLEMENTATION_ALL }
 

Functions

dom_exception dom_implementation_has_feature (const char *feature, const char *version, bool *result)
 
dom_exception dom_implementation_create_document_type (const char *qname, const char *public_id, const char *system_id, struct dom_document_type **doctype)
 
dom_exception dom_implementation_create_document (uint32_t impl_type, const char *namespace, const char *qname, struct dom_document_type *doctype, dom_events_default_action_fetcher daf, void *daf_ctx, struct dom_document **doc)
 
dom_exception dom_implementation_get_feature (const char *feature, const char *version, void **object)
 

Typedef Documentation

◆ dom_implementation

typedef const char dom_implementation

◆ dom_implementation_type

Enumeration Type Documentation

◆ dom_implementation_type

Enumerator
DOM_IMPLEMENTATION_CORE 
DOM_IMPLEMENTATION_XML 
DOM_IMPLEMENTATION_HTML 
DOM_IMPLEMENTATION_ALL 

Function Documentation

◆ dom_implementation_create_document()

dom_exception dom_implementation_create_document ( uint32_t impl_type,
const char * namespace,
const char * qname,
struct dom_document_type * doctype,
dom_events_default_action_fetcher daf,
void * daf_ctx,
struct dom_document ** doc )

Create a document node

Parameters
impl_typeThe type of document object to create
namespaceThe namespace URI of the document element
qnameThe qualified name of the document element
doctypeThe type of document to create
docPointer to location to receive result
Returns
DOM_NO_ERR on success, DOM_INVALID_CHARACTER_ERR if ::qname is invalid, DOM_NAMESPACE_ERR if ::qname is malformed, or if ::qname has a prefix and ::namespace is NULL, or if ::qname is NULL and ::namespace is non-NULL, or if ::qname has a prefix "xml" and ::namespace is not "http://www.w3.org/XML/1998/namespace", or if ::impl does not support the "XML" feature and ::namespace is non-NULL, DOM_WRONG_DOCUMENT_ERR if ::doctype is already being used by a document, or if it was not created by ::impl, DOM_NOT_SUPPORTED_ERR if ::impl does not support the feature "XML" and the language exposed through Document does not support XML namespaces.

The document will be referenced, so the client need not do this explicitly. The client must unref the document once it has finished with it.

◆ dom_implementation_create_document_type()

dom_exception dom_implementation_create_document_type ( const char * qname,
const char * public_id,
const char * system_id,
struct dom_document_type ** doctype )

Create a document type node

Parameters
qnameThe qualified name of the document type
public_idThe external subset public identifier
system_idThe external subset system identifier
doctypePointer to location to receive result
Returns
DOM_NO_ERR on success, DOM_INVALID_CHARACTER_ERR if ::qname is invalid, DOM_NAMESPACE_ERR if ::qname is malformed, DOM_NOT_SUPPORTED_ERR if ::impl does not support the feature "XML" and the language exposed through Document does not support XML namespaces.

The doctype will be referenced, so the client need not do this explicitly. The client must unref the doctype once it has finished with it.

◆ dom_implementation_get_feature()

dom_exception dom_implementation_get_feature ( const char * feature,
const char * version,
void ** object )

Retrieve a specialized object which implements the specified feature and version

Parameters
featureThe requested feature
versionThe version number of the feature
objectPointer to location to receive object
Returns
DOM_NO_ERR.

Any memory allocated by this call should be allocated using the provided memory (de)allocation function.

◆ dom_implementation_has_feature()

dom_exception dom_implementation_has_feature ( const char * feature,
const char * version,
bool * result )

Test whether a DOM implementation implements a specific feature and version

Parameters
featureThe feature to test for
versionThe version number of the feature to test for
resultPointer to location to receive result
Returns
DOM_NO_ERR.