Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Output

A set of routines to print XML data. More...

Files

file  printer.h
 SCEW printer routines for XML output.
 

Functions

SCEW_API scew_writerscew_printer_set_writer (scew_printer *printer, scew_writer *writer)
 Sets the given SCEW writer to the specified printer. More...
 
SCEW_API scew_bool scew_printer_print_tree (scew_printer *printer, scew_tree const *tree)
 Prints the given SCEW tree to the specified printer. More...
 
SCEW_API scew_bool scew_printer_print_element (scew_printer *printer, scew_element const *element)
 Prints the given SCEW element to the specified printer. More...
 
SCEW_API scew_bool scew_printer_print_element_children (scew_printer *printer, scew_element const *element)
 Prints the given SCEW element children to the specified printer. More...
 
SCEW_API scew_bool scew_printer_print_element_attributes (scew_printer *printer, scew_element const *element)
 Prints the given SCEW element attributes to the specified printer. More...
 
SCEW_API scew_bool scew_printer_print_attribute (scew_printer *printer, scew_attribute const *attribute)
 Prints the given SCEW attribute to the specified printer. More...
 

Detailed Description

A set of routines to print XML data.

Function Documentation

SCEW_API scew_writer* scew_printer_set_writer ( scew_printer printer,
scew_writer writer 
)

Sets the given SCEW writer to the specified printer.

After this call, subsequent calls to output functions will use the given writer internally. This means that the printer can be used to writer to a file or memory buffer indistinctly.

Parameters
printerthe SCEW printer to change its writer for.
writerthe SCEW writer to be used in next output calls.
Returns
the old SCEW writer.
SCEW_API scew_bool scew_printer_print_tree ( scew_printer printer,
scew_tree const *  tree 
)

Prints the given SCEW tree to the specified printer.

This will print the XML declaration, the preamble and the root element with all its children.

Precondition
printer != NULL
tree != NULL
Parameters
printerthe printer to be used for printing data.
treethe SCEW tree to print.
SCEW_API scew_bool scew_printer_print_element ( scew_printer printer,
scew_element const *  element 
)

Prints the given SCEW element to the specified printer.

This will print the element (with its attributes) and all its children recursively.

Precondition
printer != NULL
element != NULL
Parameters
printerthe printer to be used for printing data.
elementthe SCEW element to print.
SCEW_API scew_bool scew_printer_print_element_children ( scew_printer printer,
scew_element const *  element 
)

Prints the given SCEW element children to the specified printer.

This will print the element children recursively.

Precondition
printer != NULL
element != NULL
Parameters
printerthe printer to be used for printing data.
elementthe SCEW element to print its children for. The element itself is not printed.
SCEW_API scew_bool scew_printer_print_element_attributes ( scew_printer printer,
scew_element const *  element 
)

Prints the given SCEW element attributes to the specified printer.

This will print the list of the element attributes. Note that this will note generate any valid XML data, but might be useful in some cases.

Precondition
printer != NULL
element != NULL
Parameters
printerthe printer to be used for printing data.
elementthe SCEW element to print its attributes for.
SCEW_API scew_bool scew_printer_print_attribute ( scew_printer printer,
scew_attribute const *  attribute 
)

Prints the given SCEW attribute to the specified printer.

Note that this will note generate any valid XML data, but might be useful in some cases.

Precondition
printer != NULL
attribute != NULL
Parameters
printerthe printer to be used for printing data.
attributethe SCEW attribute to print.