Top |
raptor_qname * | raptor_new_qname () |
raptor_qname * | raptor_new_qname_from_namespace_local_name () |
raptor_qname * | raptor_new_qname_from_namespace_uri () |
raptor_qname * | raptor_qname_copy () |
void | raptor_free_qname () |
int | raptor_qname_equal () |
raptor_uri * | raptor_qname_string_to_uri () |
int | raptor_qname_write () |
unsigned char * | raptor_qname_format_as_xml () |
const unsigned char * | raptor_qname_get_counted_value () |
const unsigned char * | raptor_qname_get_local_name () |
const raptor_namespace * | raptor_qname_get_namespace () |
const unsigned char * | raptor_qname_get_value () |
unsigned char * | raptor_qname_to_counted_name () |
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
,const char *name
,const unsigned char *value
);
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.
raptor_qname * raptor_new_qname_from_namespace_local_name (raptor_world *world
,raptor_namespace *ns
,const char *local_name
,const 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_qname * raptor_new_qname_from_namespace_uri (raptor_namespace_stack *nstack
,raptor_uri *uri
,int xml_version
);
Make an appropriate XML Qname from the namespaces on a namespace stack
Makes a qname from the in-scope namespaces in a stack if the URI matches the prefix and the rest is a legal XML name.
raptor_qname *
raptor_qname_copy (raptor_qname *qname
);
Copy constructor - copy an existing XML qname.
void
raptor_free_qname (raptor_qname *name
);
Destructor - destroy a raptor_qname object.
int raptor_qname_equal (raptor_qname *name1
,raptor_qname *name2
);
Compare two XML Qnames for equality.
raptor_uri * raptor_qname_string_to_uri (raptor_namespace_stack *nstack
,const char *name
,size_t name_len
);
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); 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.
nstack |
raptor_namespace_stack to decode the namespace |
|
name |
QName string or NULL |
|
name_len |
QName string length |
int raptor_qname_write (raptor_qname *qname
,raptor_iostream *iostr
);
Write a formatted qname to an iostream
unsigned char * raptor_qname_format_as_xml (const raptor_qname *qname
,size_t *length_p
);
Format a qname in an XML style into a newly allocated string.
Generates a string of the form a:b="value" or a="value" depending on the qname's prefix. Double quotes are always used.
If length_p
is not NULL, the length of the string is
stored in the address it points to.
const unsigned char * raptor_qname_get_counted_value (raptor_qname *name
,size_t *length_p
);
Get the raptor_value of an XML QName.
const unsigned char *
raptor_qname_get_local_name (raptor_qname *name
);
Get the raptor_local_name of an XML QName.
const raptor_namespace *
raptor_qname_get_namespace (raptor_qname *name
);
Get the raptor_namespace of an XML QName.
const unsigned char *
raptor_qname_get_value (raptor_qname *name
);
Get the raptor_value of an XML QName.
unsigned char * raptor_qname_to_counted_name (raptor_qname *qname
,size_t *length_p
);
Get the string form of a QName name
Navigation: Redland Home Page