Use this function to get the value of the namespace attribute for the specified syntax element.
You must previously have set the syntax element name by using cniSetElementNamespace or cpiSetElementNamespace.
Use this function when you want to convert a message that belongs to a namespace-aware domain to a bit stream.
CciSize cniElementNamespace(
int* returnCode,
CciElement* targetElement,
const CciChar* value,
CciSize length)
if (element != 0) {
/*get name*/
cniElementName(&rc, element, (CciChar*)&elementName, sizeof(elementName));
/*get namespace*/
elementNamespace=(CciChar*)malloc(sizeof(CciChar) * elementNamespaceLength);
elementNamespaceLength = cniElementNamespace(&rc,
element,
elementNamespace,
elementNamespaceLength);
if (rc==CCI_BUFFER_TOO_SMALL){
free(elementNamespace);
elementNamespace=(CciChar*)malloc(sizeof(CciChar) * elementNamespaceLength);
elementNamespaceLength = cniElementNamespace(&rc,
element,
elementNamespace,
elementNamespaceLength);
}
checkRC(rc);