Raptor RDF Syntax Parsing and Serializing Library Manual | ||||
---|---|---|---|---|
Top | Description |
typedef raptor_sax2; raptor_sax2* raptor_new_sax2 (void *user_data, raptor_error_handlers *error_handlers); void raptor_free_sax2 (raptor_sax2 *sax2); void (*raptor_sax2_start_element_handler) (void *user_data, raptor_xml_element *xml_element); void (*raptor_sax2_end_element_handler) (void *user_data, raptor_xml_element *xml_element); void (*raptor_sax2_characters_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s, int len); void (*raptor_sax2_cdata_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s, int len); void (*raptor_sax2_comment_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s); void (*raptor_sax2_unparsed_entity_decl_handler) (void *user_data, unsigned char *entityName, unsigned char *base, unsigned char *systemId, unsigned char *publicId, unsigned char *notationName); int (*raptor_sax2_external_entity_ref_handler) (void *user_data, unsigned char *context, unsigned char *base, unsigned char *systemId, unsigned char *publicId); void raptor_sax2_set_start_element_handler (raptor_sax2 *sax2, raptor_sax2_start_element_handler handler); void raptor_sax2_set_end_element_handler (raptor_sax2 *sax2, raptor_sax2_end_element_handler handler); void raptor_sax2_set_characters_handler (raptor_sax2 *sax2, raptor_sax2_characters_handler handler); void raptor_sax2_set_cdata_handler (raptor_sax2 *sax2, raptor_sax2_cdata_handler handler); void raptor_sax2_set_comment_handler (raptor_sax2 *sax2, raptor_sax2_comment_handler handler); void raptor_sax2_set_unparsed_entity_decl_handler (raptor_sax2 *sax2, raptor_sax2_unparsed_entity_decl_handler handler); void raptor_sax2_set_external_entity_ref_handler (raptor_sax2 *sax2, raptor_sax2_external_entity_ref_handler handler); void raptor_sax2_set_namespace_handler (raptor_sax2 *sax2, raptor_namespace_handler handler); void raptor_sax2_parse_start (raptor_sax2 *sax2, raptor_uri *base_uri); int raptor_sax2_parse_chunk (raptor_sax2 *sax2, unsigned char *buffer, size_t len, int is_end); const unsigned char* raptor_sax2_inscope_xml_language (raptor_sax2 *sax2); raptor_uri* raptor_sax2_inscope_base_uri (raptor_sax2 *sax2);
raptor_sax2* raptor_new_sax2 (void *user_data, raptor_error_handlers *error_handlers);
Constructor - Create a new SAX2 with error handlers
|
pointer context information to pass to handlers |
|
error handlers pointer |
Returns : |
new raptor_sax2 object or NULL on failure |
void raptor_free_sax2 (raptor_sax2 *sax2);
Destructor - destroy a SAX2 object
|
SAX2 object |
void (*raptor_sax2_start_element_handler) (void *user_data, raptor_xml_element *xml_element);
SAX2 start element handler
|
user data |
|
XML element |
void (*raptor_sax2_end_element_handler) (void *user_data, raptor_xml_element *xml_element);
SAX2 end element handler
|
user data |
|
XML element |
void (*raptor_sax2_characters_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s, int len);
SAX2 characters handler
|
user data |
|
XML element |
|
string |
|
string len |
void (*raptor_sax2_cdata_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s, int len);
SAX2 CDATA section handler
|
user data |
|
XML element |
|
string |
|
string len |
void (*raptor_sax2_comment_handler) (void *user_data, raptor_xml_element *xml_element, unsigned char *s);
SAX2 XML comment handler
|
user data |
|
XML element |
|
string |
void (*raptor_sax2_unparsed_entity_decl_handler) (void *user_data, unsigned char *entityName, unsigned char *base, unsigned char *systemId, unsigned char *publicId, unsigned char *notationName);
SAX2 unparsed entity (NDATA) handler
|
user data |
|
entity name |
|
base URI |
|
system ID |
|
public ID |
|
notation name |
int (*raptor_sax2_external_entity_ref_handler) (void *user_data, unsigned char *context, unsigned char *base, unsigned char *systemId, unsigned char *publicId);
SAX2 external entity reference handler
|
user data |
|
context |
|
base URI |
|
system ID |
|
public ID |
Returns : |
0 if processing should not continue because of a fatal error in the handling of the external entity. |
void raptor_sax2_set_start_element_handler (raptor_sax2 *sax2, raptor_sax2_start_element_handler handler);
Set SAX2 start element handler.
|
SAX2 object |
|
start element handler |
void raptor_sax2_set_end_element_handler (raptor_sax2 *sax2, raptor_sax2_end_element_handler handler);
Set SAX2 end element handler.
|
SAX2 object |
|
end element handler |
void raptor_sax2_set_characters_handler (raptor_sax2 *sax2, raptor_sax2_characters_handler handler);
Set SAX2 characters handler.
|
SAX2 object |
|
characters handler |
void raptor_sax2_set_cdata_handler (raptor_sax2 *sax2, raptor_sax2_cdata_handler handler);
Set SAX2 CDATA handler.
|
SAX2 object |
|
CDATA handler |
void raptor_sax2_set_comment_handler (raptor_sax2 *sax2, raptor_sax2_comment_handler handler);
Set SAX2 XML comment handler.
|
SAX2 object |
|
comment handler |
void raptor_sax2_set_unparsed_entity_decl_handler (raptor_sax2 *sax2, raptor_sax2_unparsed_entity_decl_handler handler);
Set SAX2 XML unparsed entity declaration handler.
|
SAX2 object |
|
unparsed entity declaration handler |
void raptor_sax2_set_external_entity_ref_handler (raptor_sax2 *sax2, raptor_sax2_external_entity_ref_handler handler);
Set SAX2 XML entity reference handler.
|
SAX2 object |
|
entity reference handler |
void raptor_sax2_set_namespace_handler (raptor_sax2 *sax2, raptor_namespace_handler handler);
Set the XML namespace handler function.
When a prefix/namespace is seen in an XML parser, call the given
handler
with the prefix string and the raptor_uri namespace URI.
Either can be NULL for the default prefix or default namespace.
The handler function does not deal with duplicates so any namespace may be declared multiple times when a namespace is seen in different parts of a document.
|
raptor_sax2 object |
|
new namespace callback function |
void raptor_sax2_parse_start (raptor_sax2 *sax2, raptor_uri *base_uri);
Start an XML SAX2 parse.
|
sax2 object |
|
base URI |
int raptor_sax2_parse_chunk (raptor_sax2 *sax2, unsigned char *buffer, size_t len, int is_end);
Parse a chunk of XML data generating SAX2 events
|
sax2 object |
|
input buffer |
|
input buffer lenght |
|
non-0 if end of data |
Returns : |
non-0 on failure |
const unsigned char* raptor_sax2_inscope_xml_language (raptor_sax2 *sax2);
Get the in-scope XML language
|
SAX2 object |
Returns : |
the XML language or NULL if none is in scope. |
raptor_uri* raptor_sax2_inscope_base_uri (raptor_sax2 *sax2);
Get the in-scope base URI
|
SAX2 object |
Returns : |
the in-scope base URI shared object or NULL if none is in scope. |