WebSphere Message Brokers
File: as07870_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:37:36

cniCreateElementAsLastChildUsingParser

Creates a new syntax element as the last child of the specified syntax element, and associates it with the specified parser class name.

A portion of the syntax element tree that is owned by a parser can only have its effective root at the first generation of elements (that is, as immediate children of root). The user-defined node interface does not restrict the ability to create a subtree that appears to be owned by a different parser. However, it is not possible to serialize these element trees into a bit stream when outputting a message.

If you specify the name of a parser supplied with WebSphere Message Broker, you must use the correct class name of the parser. See C node implementation functions for a list of the supplied parsers.

If you use this function to create a BLOB parser folder, the internal name for the BLOB parser is none. Therefore, if you use this function to create a BLOB parser folder, the associated parser name should be none.

The internal name for the BLOB parser is none. Therefore, if you use this function to create a BLOB parser folder, the associated parser name should be none.

Syntax

CciElement* cniCreateElementAsLastChildUsingParser(
  int*            returnCode,
  CciElement*     targetElement,
  const CciChar*  parserClassName);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
  • CCI_INV_PARSER_NAME
targetElement
The address of the element object (input).
parserClassName
The name of the parser class (input).

Return values

If successful, the address of the new element object is returned. Otherwise, a value of zero (CCI_NULL_ADDR) is returned, and the returnCode parameter indicates the reason for the error.

Example

    cniElementName(&rc, firstChild, elementName);
    CciElementType type = cniElementType(&rc, firstChild);
    CciElement* lastChild = cniCreateElementAsLastChildUsingParser(
                                                                  &rc, 
                                                                  outRootElement, 
                                                                  parserName);
    cniSetElementName(&rc, lastChild, elementName);
    cniSetElementType(&rc, lastChild, elementType);
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:37:36

as07870_ This topic's URL is: