Redland
view release on metacpan or search on metacpan
redland/raptor/docs/libraptor.3 view on Meta::CPAN
.SH "XML ELEMENT DESTRUCTOR"
.IP "\fBvoid raptor_free_xml_element(raptor_xml_element *\fIelement\fP)\fR"
Destroy a XML element object.
.SH "XML ELEMENT METHODS"
.IP "\fBraptor_qname* raptor_xml_element_get_name(raptor_xml_element* \fIxml_element\fP)\fR"
Get the XML element QName of XML element \fIxml_element\fP.
.IP "\fBvoid raptor_xml_element_set_attributes(raptor_xml_element* \fIxml_element\fP, raptor_qname **\fIattributes\fP, int \fIcount\fP)\fR"
Set the attributes on XML element \fIxml_element\fP to the
array of QNames in array \fIattributes\fP of size \fIcount\fP.
.IP "\fBraptor_qname** raptor_xml_element_get_attributes(raptor_xml_element* \fIxml_element\fP)\fR"
Get the attributes of an XML element \fIxml_element\fP as an
array of QNames. As set by \fBvoid raptor_xml_element_set_attributes\fP.
.IP "\fBint raptor_xml_element_get_attributes_count(raptor_xml_element* \fIxml_element\fP)\fR"
Get the number of attributes of an XML element \fIxml_element\fP as
set by \fBvoid raptor_xml_element_set_attributes\fP.
.IP "\fBint raptor_xml_element_declare_namespace(raptor_xml_element* \fIxml_element\fP, raptor_namespace* \fInspace\fP)\fR"
Declare an XML namespace \fInspace\fP expliclitly on XML element
\fIxml_element\fP. Namespaces used in the element or attribute
names are automatically declared, this method allows additional ones
to be done.
.IP "\fBint raptor_xml_element_is_empty(raptor_xml_element*\fI xml_element\fP)"
Return non-0 if the XML element is empty.
.IP "\fBint raptor_iostream_write_xml_element(raptor_iostream* \fIiostr\fP, raptor_xml_element *\fIelement\fP, raptor_namespace_stack* \fInstack\fP, int \fIis_empty\fP, int \fIis_end\fP, raptor_simple_message_handler \fIerror_handler\fP, void* \fIerr...
Write a XML element \fIxml_element\fP to iostream \fIostr\fP.
This is done in context of an XML namespace stack \fInstack\fP and
at depth \fIdepth\fP in the stack (see Namespace class constructors).
.IP
The element may be an empty element if \fIis_empty\fP is non-zero or may
be a close element if \fIis_end\fP is non-zero (else is a start
element). The \fIerror_handler\fR method along
with \fIerror_data\fR allow error reporting to be given.
.SH "XML WRITER CLASS"
This class provides the functionality to generate simple XML documents
consisting of elements with attributes, character data and
comments. The documents can be written to an iostream.
.SH "XML WRITER CONSTRUCTOR"
.IP "\fBraptor_xml_writer* raptor_new_xml_writer(raptor_namespace_stack* \fInstack\fP, raptor_uri_handler* \fIuri_handler\fP, void* \fIuri_context\fP, raptor_iostream* \fIiostr\fP, raptor_simple_message_handler \fIerror_handler\fP, void *\fIerror_dat...
Create a new XML Writer writing to iostream \fIiostr\fP.
The \fIerror_handler\fR method along
with \fIerror_data\fR allow error reporting to be given.
\fInstack\fP is either an existing namespace stack to be used or if
NULL, a new one with only the XML namespace defined is created.
Note that \fBraptor_uri_get_handler\fR can be useful to return the
current raptor URI handler/context. \fIcanonicalize\fP is currently
unused and should be set to 1 but may allow non-canonical XML writing
to be allowed in future.
.SH "XML WRITER DESTRUCTOR"
.IP "\fBvoid raptor_free_xml_writer(raptor_xml_writer* \fIxml_writer\fP)\fR"
Destroy a XML Writer object.
.SH "XML WRITER METHODS"
.IP "\fBvoid raptor_xml_writer_empty_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write XML element \fIelement\fP as an empty element (no element
content) to the XML Writer \fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_start_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write a start element along with an attributes and namespace
declarations for XML element \fIelement\fP to the XML Writer
\fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_end_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write an end element form for XML element \fIelement\fP
to the XML Writer \fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_cdata(raptor_xml_writer* \fIxml_writer\fP, const unsigned char *str)\fR"
Write XML character data in \fIstr\fP to the XML Writer
\fIxml_writer\fP. The characters in \fIstr\fP will be XML escaped.
.IP "\fBvoid raptor_xml_writer_cdata_counted(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP, unsigned int \fIlength\fP)\fR"
Write XML character data in \fIstr\fP of length \fIlength\fP to the XML Writer
\fIxml_writer\fP. The characters in \fIstr\fP will be XML escaped.
.IP "\fBvoid raptor_xml_writer_raw(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP)\fR"
Write character data in \fIstr\fP \fIlength\fP to the XML Writer
\fIxml_writer\fP without XML escaping.
.IP "\fBvoid raptor_xml_writer_raw_counted(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP, unsigned int \fIlength\fP)\fR"
Write character data in \fIstr\fP of length \fIlength\fP to the XML Writer
\fIxml_writer\fP without XML escaping.
.IP "\fBvoid raptor_xml_writer_comment(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP)\fR"
Write an XML comment in \fIstr\fP to the XML Writer \fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_comment_counted(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP, unsigned int \fIlength\fP)\fR"
Write an XML comment in \fIstr\fP of length \fIlength\fP to the XML
Writer \fIxml_writer\fP.
.IP "\fBint raptor_xml_writer_features_enumerate(const raptor_feature \fIfeature\fP, const char **\fIname\fP, raptor_uri **\fIuri\fP, const char **\fIlabel\fP)\fR"
Return the name, URI, string label (all optional)
for an XML write \fIfeature\fP, returning non-zero if no such feature exists.
.P
Raptor features have URIs that are constructed from the URI
\fIhttp://feature.librdf.org/raptor-\fP and the \fIname\fP
so for example feature \fIscanForRDF\fP
has URI \fIhttp://feature.librdf.org/raptor-scanForRDF\fP
.IP "\fBint raptor_xml_writer_set_feature(raptor_xml_writer* \fIxml_writer\fP, raptor_feature \fIfeature\fP, int \fIvalue\fP)\fR"
Set an XML writer feature \fIfeature\fR to a particular \fIvalue\fR.
Returns non 0 on failure or if the feature is unknown.
The current defined writer features are:
\fIFeature Values\fR
\fBRAPTOR_FEATURE_WRITER_AUTO_INDENT\fR Boolean (non 0 true)
\fBRAPTOR_FEATURE_WRITER_AUTO_EMPTY\fR Boolean (non 0 true)
\fBRAPTOR_FEATURE_WRITER_INDENT_WIDTH\fR Integer
\fBRAPTOR_FEATURE_WRITER_XML_DECLARATION\fR Boolean (non 0 true)
.P
If the \fIwriter_auto_indent\fR
feature is set (default true), the XML writer will automatically
indent the output.
.P
If the \fIwriter_auto_empty\fR
feature is set (default true), the XML writer will automatically
generate empty elements if a start/end element sequence has no content.
.P
If the \fIwriter_indent_width\fR
feature is set (default 2) if the XML writer is outputing indented
XML, it will use that many spaces.
.P
If the \fIwriter_xml_declaration\fR
feature is set (default true) the XML declaration is written at the
start of serialized XML.
.IP "\fBint raptor_xml_writer_set_feature_string(raptor_xml_writer *xml_writer, raptor_feature feature, const unsigned char *value)\fR"
Set an XML writer feature \fIfeature\fR to a particular string \fIvalue\fR.
Returns non 0 on failure or if the feature is unknown.
The current defined XML writer features are given in
\fBraptor_xml_writer_set_feature\fP and at present only take integer values. If
an integer value feature is set with this function, \fIvalue\fP is
interpreted as an integer and then that value is used.
.IP "\fBint raptor_xml_writer_get_feature(raptor_xml_writer* \fIxml_writer\fP, raptor_feature \fIfeature\fP)\fR"
Get XML writer feature integer values. The allowed \fIfeature\fP values
and types are given under \fBraptor_xml_writer_features_enumerate\fP.
.IP "\fBconst unsigned char *raptor_xml_writer_get_feature_string(raptor_xml_writer* \fIxml_writer\fP, raptor_feature \fIfeature\fP)\fR"
Get XML writer feature string values. The allowed \fIfeature\fP values
and types are given under \fBraptor_xml_writer_features_enumerate\fP.
.SH API CHANGES
( run in 2.231 seconds using v1.01-cache-2.11-cpan-99c4e6809bf )