yumapro  20.10-10
YumaPro SDK
XML Output Functions

XML output to a session control block or a file. More...

Collaboration diagram for XML Output Functions:

Data Structures

struct  walker_cookie_t
 XML walker cookie for GET callback processing. More...
 

Functions

void xml_wr_buff (ses_cb_t *scb, const xmlChar *buff, uint32 bufflen)
 Write some xmlChars to the specified session. More...
 
void xml_wr_begin_elem_ex (ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
 Write a start or empty XML tag to the specified session. More...
 
void xml_wr_begin_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
 Write a start XML tag to the specified session without attributes. More...
 
void xml_wr_empty_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
 Write an empty XML tag to the specified session without attributes. More...
 
void xml_wr_end_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
 Write an end tag to the specified session. More...
 
void xml_wr_string_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *str, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent)
 Write a start tag, simple string content, and an end tag to the specified session. More...
 
void xml_wr_uint32_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, uint32 num, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent)
 Write a start tag, simple uint32 content, and an end tag to the specified session. More...
 
void xml_wr_qname_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t val_nsid, const xmlChar *str, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean isdefault)
 Write a start tag, QName string content, and an end tag to the specified session. More...
 
void xml_wr_check_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn)
 Write an NCX value in XML encoding while checking nodes for suppression of output with the supplied test fn. More...
 
void xml_wr_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
 Output val_value_t node contents only. More...
 
void xml_wr_max_check_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns)
 Generate entire val_value_t *w/filter) More...
 
void xml_wr_max_check_val_force (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns, xmlns_id_t force_nsid, const xmlChar *force_name)
 Generate entire val_value_t *w/filter) More...
 
void xml_wr_full_check_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean expand_varexpr)
 Generate entire val_value_t *w/filter) More...
 
void xml_wr_full_check_val2 (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns, boolean expand_varexpr, xmlns_id_t parent_nsid)
 Generate entire val_value_t *w/filter) More...
 
void xml_wr_file_write_check_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean expand_varexpr, boolean file_write)
 Generate entire val_value_t *w/filter) More...
 
void xml_wr_full_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
 Generate entire val_value_t. More...
 
void xml_wr_full_val_origin (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
 Generate entire val_value_t with NMDA origin. More...
 
status_t xml_wr_check_open_file (FILE *fp, val_value_t *val, xml_attrs_t *attrs, boolean docmode, boolean xmlhdr, boolean withns, boolean expand_varexpr, boolean with_owners, int32 startindent, int32 indent, val_nodetest_fn_t testfn)
 Write the specified value to an open FILE in XML format. More...
 
status_t xml_wr_check_open_file_ex (FILE *fp, val_value_t *val, xml_attrs_t *attrs, boolean docmode, boolean xmlhdr, boolean withns, boolean expand_varexpr, boolean with_owners, boolean top_meta, int32 startindent, int32 indent, val_nodetest_fn_t testfn)
 Write the specified value to an open FILE in XML format Extended. More...
 
status_t xml_wr_check_file (const xmlChar *filespec, val_value_t *val, xml_attrs_t *attrs, boolean docmode, boolean xmlhdr, boolean withns, boolean expand_varexpr, boolean with_owners, int32 startindent, int32 indent, val_nodetest_fn_t testfn)
 Write the specified value to a FILE in XML format. More...
 
status_t xml_wr_file (const xmlChar *filespec, val_value_t *val, xml_attrs_t *attrs, boolean docmode, boolean xmlhdr, boolean withns, boolean expand_varexpr, boolean with_owners, int32 startindent, int32 indent)
 Write the specified value to a FILE in XML format. More...
 
void xml_wr_check_child_obj (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn)
 Generate entire val_value_t *w/filter) for GET2. More...
 
void xml_wr_check_child_obj_ex (ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *parent_get2cb, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn)
 Write an entire <get2> val_value_t out from the obj_template_t callback. More...
 

Detailed Description

XML output to a session control block or a file.

Function Documentation

void xml_wr_begin_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
int32  indent 
)

Write a start XML tag to the specified session without attributes.

This is a low-level output function usually used internally

Parameters
scbsession control block
msgtop header from message in progress
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline

Here is the caller graph for this function:

void xml_wr_begin_elem_ex ( ses_cb_t scb,
xml_msg_hdr_t msg,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
const dlq_hdr_t *  attrQ,
boolean  isattrq,
int32  indent,
boolean  empty 
)

Write a start or empty XML tag to the specified session.

This is a low-level output function usually used internally

Parameters
scbsession control block
msgtop header from message in progress
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
attrQQ of xml_attr_t or val_value_t records to write in the element; NULL == none
isattrqTRUE if the qQ contains xml_attr_t nodes FALSE if the Q contains val_value_t nodes (metadata)
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline
emptyTRUE for empty node
FALSE for start node

Here is the caller graph for this function:

void xml_wr_buff ( ses_cb_t scb,
const xmlChar *  buff,
uint32  bufflen 
)

Write some xmlChars to the specified session.

Simply writes the chars in buff to session scb

Parameters
scbsession control block to start msg
buffbuffer to write
bufflennumber of bytes to write, not including any EOS char at the end of the buffer

Here is the call graph for this function:

void xml_wr_check_child_obj ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
obj_template_t objnode,
int32  indent,
val_nodetest_fn_t  testfn 
)

Generate entire val_value_t *w/filter) for GET2.

Write an entire <get2> val_value_t out from the obj_template_t callback Using an optional testfn to filter output This is the main API for server access to operational data

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valparent of the object to write
objnodechild object node to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_check_child_obj_ex ( ses_cb_t scb,
xml_msg_hdr_t msg,
getcb_get2_t parent_get2cb,
obj_template_t objnode,
int32  indent,
val_nodetest_fn_t  testfn 
)

Write an entire <get2> val_value_t out from the obj_template_t callback.

Using an optional testfn to filter output Start from parent_get2cb, not parent object node

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
parent_get2cbparent get2 control block of the object to write
objnodechild object node to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used

Here is the call graph for this function:

status_t xml_wr_check_file ( const xmlChar *  filespec,
val_value_t val,
xml_attrs_t attrs,
boolean  docmode,
boolean  xmlhdr,
boolean  withns,
boolean  expand_varexpr,
boolean  with_owners,
int32  startindent,
int32  indent,
val_nodetest_fn_t  testfn 
)

Write the specified value to a FILE in XML format.

This is a main module API for high level code. A test function is added.

Parameters
filespecexact path of filename to open
valvalue for output
attrstop-level attributes to generate
docmodeTRUE if XML_DOC output mode should be used
FALSE if XML output mode should be used
xmlhdrTRUE if <?xml?> directive should be output
FALSE if not
withnsTRUE if xmlns attributes should be used
FALSE to leave them out
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
with_ownersTRUE to generate ywx:owner attributes as needed
startindentstarting indent point
indentindent amount (0..9 spaces)
testfncallback test function to use (NULL for no test)
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t xml_wr_check_open_file ( FILE *  fp,
val_value_t val,
xml_attrs_t attrs,
boolean  docmode,
boolean  xmlhdr,
boolean  withns,
boolean  expand_varexpr,
boolean  with_owners,
int32  startindent,
int32  indent,
val_nodetest_fn_t  testfn 
)

Write the specified value to an open FILE in XML format.

This is a main module API for high level code

Parameters
fpopen FILE control block
valvalue for output
attrstop-level attributes to generate
docmodeTRUE if XML_DOC output mode should be used
FALSE if XML output mode should be used
xmlhdrTRUE if <?xml?> directive should be output
FALSE if not
withnsTRUE if xmlns attributes should be used
FALSE to leave them out
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
with_ownersTRUE to generate ywx:owner attributes as needed
startindentstarting indent point
indentindent amount (0..9 spaces)
testfncallback test function to use (NULL for no test)
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t xml_wr_check_open_file_ex ( FILE *  fp,
val_value_t val,
xml_attrs_t attrs,
boolean  docmode,
boolean  xmlhdr,
boolean  withns,
boolean  expand_varexpr,
boolean  with_owners,
boolean  top_meta,
int32  startindent,
int32  indent,
val_nodetest_fn_t  testfn 
)

Write the specified value to an open FILE in XML format Extended.

This is a main module API for high level code. The top_meta parameter is added.

Parameters
fpopen FILE control block
valvalue for output
attrstop-level attributes to generate
docmodeTRUE if XML_DOC output mode should be used
FALSE if XML output mode should be used
xmlhdrTRUE if <?xml?> directive should be output
FALSE if not
withnsTRUE if xmlns attributes should be used
FALSE to leave them out
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
with_ownersTRUE to generate ywx:owner attributes as needed
top_metaTRUE to check val->metaQ id attrs is NULL
startindentstarting indent point
indentindent amount (0..9 spaces)
testfncallback test function to use (NULL for no test)
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_check_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn 
)

Write an NCX value in XML encoding while checking nodes for suppression of output with the supplied test fn.

!!! NOTE !!!

This function generates the contents of the val_value_t but not the top node itself. This function is called recursively and this is the intended behavior.

To generate XML for an entire val_value_t, including the top-level node, use the xml_wr_full_val fn.

If the acm_cache and acm_cbfn fields are set in the msg header then access control will be checked If FALSE, then nothing will be written to the output session

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_empty_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
int32  indent 
)

Write an empty XML tag to the specified session without attributes.

This is a low-level output function usually used internally

Parameters
scbsession control block
msgtop header from message in progress
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline

Here is the caller graph for this function:

void xml_wr_end_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
xmlns_id_t  nsid,
const xmlChar *  elname,
int32  indent 
)

Write an end tag to the specified session.

This is a low-level output function usually used internally

Parameters
scbsession control block
msgtop header from message in progress
nsidnamespace ID of the element to write
zero to force no prefix lookup; use default NS
elnameunqualified name of element to write
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline

Here is the call graph for this function:

Here is the caller graph for this function:

status_t xml_wr_file ( const xmlChar *  filespec,
val_value_t val,
xml_attrs_t attrs,
boolean  docmode,
boolean  xmlhdr,
boolean  withns,
boolean  expand_varexpr,
boolean  with_owners,
int32  startindent,
int32  indent 
)

Write the specified value to a FILE in XML format.

This is a main module API for high level code.

Parameters
filespecexact path of filename to open
valvalue for output
attrstop-level attributes to generate
docmodeTRUE if XML_DOC output mode should be used
FALSE if XML output mode should be used
xmlhdrTRUE if <?xml?> directive should be output
FALSE if not
withnsTRUE if xmlns attributes should be used
FALSE to leave them out
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
with_ownersTRUE to generate ywx:owner attributes as needed
startindentstarting indent point
indentindent amount (0..9 spaces)
Returns
status

Here is the call graph for this function:

void xml_wr_file_write_check_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn,
boolean  expand_varexpr,
boolean  file_write 
)

Generate entire val_value_t *w/filter)

Write an entire val_value_t out as XML, including the top level Using an optional testfn to filter output and file_write to specify how to handle ncx:password nodes

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
file_writeTRUE if write the specified value to an open FILE in XML format; FALSE otherwise
void xml_wr_full_check_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn,
boolean  expand_varexpr 
)

Generate entire val_value_t *w/filter)

Write an entire val_value_t out as XML, including the top level Using an optional testfn to filter output

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions

Here is the caller graph for this function:

void xml_wr_full_check_val2 ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn,
boolean  force_xmlns,
boolean  expand_varexpr,
xmlns_id_t  parent_nsid 
)

Generate entire val_value_t *w/filter)

Write an entire val_value_t out as XML, including the top level Using an optional testfn to filter output

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used
force_xmlnsforce XMLNS attribute
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
parent_nsidnaespace ID of parent node (0 if unknown)
void xml_wr_full_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent 
)

Generate entire val_value_t.

Write an entire val_value_t out as XML, including the top level

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_full_val_origin ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent 
)

Generate entire val_value_t with NMDA origin.

Write an entire val_value_t out as XML, including the top level Send NMDA origin attribute if set in the val_value_t

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled

Here is the caller graph for this function:

void xml_wr_max_check_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn,
boolean  force_xmlns 
)

Generate entire val_value_t *w/filter)

Write an entire val_value_t out as XML, including the top level Using an optional testfn to filter output

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used
force_xmlnsforce XMLNS attribute
void xml_wr_max_check_val_force ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent,
val_nodetest_fn_t  testfn,
boolean  force_xmlns,
xmlns_id_t  force_nsid,
const xmlChar *  force_name 
)

Generate entire val_value_t *w/filter)

Write an entire val_value_t out as XML, including the top level Using an optional testfn to filter output

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled
testfncallback function to use, NULL if not used
force_xmlnsforce XMLNS attribute
force_nsidtop-level NSID to use instead of val (if set)
force_nametop-level name to use instead of val (if set)
void xml_wr_qname_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
xmlns_id_t  val_nsid,
const xmlChar *  str,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
const dlq_hdr_t *  attrQ,
boolean  isattrq,
int32  indent,
boolean  isdefault 
)

Write a start tag, QName string content, and an end tag to the specified session.

The ses_start_msg must be called before this function, in order for it to allow any writes

Parameters
scbsession control block
msgtop header from message in progress
val_nsidnamespace ID of the QName prefix
strlocal-name part of the QName
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
attrQQ of xml_attr_t or val_value_t records to write in the element; NULL == none
isattrqTRUE if the qQ contains xml_attr_t nodes FALSE if the Q contains val_value_t nodes (metadata)
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline
isdefaultTRUE if the XML value node represents a default leaf
== FALSE otherwise

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_string_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
const xmlChar *  str,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
const dlq_hdr_t *  attrQ,
boolean  isattrq,
int32  indent 
)

Write a start tag, simple string content, and an end tag to the specified session.

A flag element and ename will vary from this format.

Simple content nodes are completed on a single line to prevent introduction of extra whitespace

Parameters
scbsession control block
msgtop header from message in progress
strsimple string to write as element content
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
attrQQ of xml_attr_t or val_value_t records to write in the element; NULL == none
isattrqTRUE if the qQ contains xml_attr_t nodes FALSE if the Q contains val_value_t nodes (metadata)
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline

Here is the call graph for this function:

Here is the caller graph for this function:

void xml_wr_uint32_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
uint32  num,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
const dlq_hdr_t *  attrQ,
boolean  isattrq,
int32  indent 
)

Write a start tag, simple uint32 content, and an end tag to the specified session.

A flag element and ename will vary from this format.

Simple content nodes are completed on a single line to prevent introduction of extra whitespace

Parameters
scbsession control block
msgtop header from message in progress
numnumber to write as element content
parent_nsidnamespace ID of the parent element, if known
nsidnamespace ID of the element to write
elnameunqualified name of element to write
attrQQ of xml_attr_t or val_value_t records to write in the element; NULL == none
isattrqTRUE if the qQ contains xml_attr_t nodes FALSE if the Q contains val_value_t nodes (metadata)
indentnumber of chars to indent after a newline
== -1 means no newline or indent
== 0 means just newline

Here is the call graph for this function:

void xml_wr_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
int32  indent 
)

Output val_value_t node contents only.

Write an NCX value node in XML encoding See xml_wr_check_write for full details of this fn. It is the same, except a NULL testfn is supplied.

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
indentstart indent amount if indent enabled

Here is the call graph for this function: