|  |  |  | Raptor RDF Syntax Parsing and Serializing Library Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
typedef raptor_qname; raptor_qname* raptor_new_qname (raptor_namespace_stack *nstack, unsigned char *name, unsigned char *value, raptor_simple_message_handler error_handler, void *error_data); raptor_qname* raptor_new_qname_from_namespace_local_name (raptor_namespace *ns, unsigned char *local_name, unsigned char *value); raptor_qname* raptor_qname_copy (raptor_qname *qname); void raptor_free_qname (raptor_qname *name); int raptor_qname_equal (raptor_qname *name1, raptor_qname *name2); raptor_uri* raptor_qname_string_to_uri (raptor_namespace_stack *nstack, unsigned char *name, size_t name_len, raptor_simple_message_handler error_handler, void *error_data); int raptor_iostream_write_qname (raptor_iostream *iostr, raptor_qname *qname); const unsigned char* raptor_qname_get_counted_value (raptor_qname *name, size_t *length_p); const unsigned char* raptor_qname_get_local_name (raptor_qname *name); const raptor_namespace* raptor_qname_get_namespace (raptor_qname *name); const unsigned char* raptor_qname_get_value (raptor_qname *name); unsigned char* raptor_qname_to_counted_name (raptor_qname *qname, size_t *length_p);
Wraps an XML name inside an associated XML namespace in some XML document context (typically). Mostly used inside parsing XML to manage qnames for XML element and attribute names.
raptor_qname* raptor_new_qname (raptor_namespace_stack *nstack, unsigned char *name, unsigned char *value, raptor_simple_message_handler error_handler, void *error_data);
Constructor - create a new XML qname.
Create a new qname from the local element/attribute name, with optional (attribute) value. The namespace stack is used to look up the name and find the namespace and generate the URI of the qname.
| 
 | namespace stack to look up for namespaces | 
| 
 | element or attribute name | 
| 
 | attribute value (else is an element) | 
| 
 | function to call on an error | 
| 
 | user data for error function | 
| Returns : | a new raptor_qname object or NULL on failure | 
raptor_qname* raptor_new_qname_from_namespace_local_name (raptor_namespace *ns, unsigned char *local_name, unsigned char *value);
Constructor - create a new XML qname.
Create a new qname from the namespace and local element/attribute name, with optional (attribute) value.
raptor_init() MUST have been called before calling this function.
Use raptor_new_qname_from_namespace_local_name_v2() if using raptor_world APIs.
| 
 | namespace of qname (or NULL) | 
| 
 | element or attribute name | 
| 
 | attribute value (else is an element) | 
| Returns : | a new raptor_qname object or NULL on failure | 
raptor_qname* raptor_qname_copy (raptor_qname *qname);
Copy constructor - copy an existing XML qname.
| 
 | existing qname | 
| Returns : | a new raptor_qname object or NULL on failure | 
void raptor_free_qname (raptor_qname *name);
Destructor - destroy a raptor_qname object.
| 
 | raptor_qname object | 
int raptor_qname_equal (raptor_qname *name1, raptor_qname *name2);
Compare two XML Qnames for equality.
| 
 | first raptor_qname | 
| 
 | second raptor_name | 
| Returns : | non-0 if the qnames are equal. | 
raptor_uri* raptor_qname_string_to_uri (raptor_namespace_stack *nstack, unsigned char *name, size_t name_len, raptor_simple_message_handler error_handler, void *error_data);
Get the URI for a qname.
Utility function to turn a string representing a QName in the N3 style, into a new URI representing it. A NULL name or name ":" returns the default namespace URI. A name "p:" returns namespace name (URI) for the namespace with prefix "p".
Partially equivalent to qname=raptor_new_qname(nstack, name, NULL, error_handler, error_data); uri=raptor_uri_copy(qname->uri); raptor_free_qname(qname) but without making the qname, and it also handles the NULL and ":" name cases as well as error checking.
| 
 | raptor_namespace_stack to decode the namespace | 
| 
 | QName string or NULL | 
| 
 | QName string length | 
| 
 | function to call on an error | 
| 
 | user data for error function | 
| Returns : | new raptor_uri object or NULL on failure | 
int raptor_iostream_write_qname (raptor_iostream *iostr, raptor_qname *qname);
Write a formatted qname to an iostream
| 
 | raptor iosteram | 
| 
 | QName to write | 
| Returns : | non-0 on failure | 
const unsigned char* raptor_qname_get_counted_value (raptor_qname *name, size_t *length_p);
Get the raptor_value of an XML QName.
| 
 | raptor_qname object | 
| 
 | pointer to variable to store length of name (or NULL) | 
| Returns : | the value | 
const unsigned char* raptor_qname_get_local_name (raptor_qname *name);
Get the raptor_local_name of an XML QName.
| 
 | raptor_qname object | 
| Returns : | the local_name | 
const raptor_namespace* raptor_qname_get_namespace (raptor_qname *name);
Get the raptor_namespace of an XML QName.
| 
 | raptor_qname object | 
| Returns : | the namespace | 
const unsigned char* raptor_qname_get_value (raptor_qname *name);
Get the raptor_value of an XML QName.
| 
 | raptor_qname object | 
| Returns : | the value | 
unsigned char* raptor_qname_to_counted_name (raptor_qname *qname, size_t *length_p);
Get the string form of a QName name
| 
 | QName to write | 
| 
 | pointer to variable to store length of name (or NULL) | 
| Returns : | string or NULL on failure |