ixml/src/node.c
static IXML_Element *ixmlNode_cloneElement(
	/*! [in] The \b Node to clone. */
	IXML_Element *nodeptr)
{
	IXML_Element *newElement;
	IXML_Node *elementNode;
	IXML_Node *srcNode;
	int rc;

	assert(nodeptr != NULL);

	newElement = (IXML_Element *)malloc(sizeof (IXML_Element));
	if (newElement == NULL) {
		return NULL;
	}

	ixmlElement_init(newElement);
	rc = ixmlElement_setTagName(newElement, nodeptr->tagName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	elementNode = (IXML_Node *)newElement;
	srcNode = (IXML_Node *)nodeptr;
	rc = ixmlNode_setNodeName(elementNode, srcNode->nodeName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	rc = ixmlNode_setNodeValue(elementNode, srcNode->nodeValue);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	rc = ixmlNode_setNamespaceURI(elementNode, srcNode->namespaceURI);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	rc = ixmlNode_setPrefix(elementNode, srcNode->prefix);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	rc = ixmlNode_setLocalName(elementNode, srcNode->localName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}

	elementNode->nodeType = eELEMENT_NODE;

	return newElement;
}
/*!
 * \brief Returns a clone of element node.
 *
 * \return A clone of element node.
 */
\brief Returns a clone of element node.
\return A clone of element node.
\ brief Returns a clone of element node . \ return A clone of element node .
static IXML_Element *ixmlNode_cloneElement(
	IXML_Element *nodeptr)
{
	IXML_Element *newElement;
	IXML_Node *elementNode;
	IXML_Node *srcNode;
	int rc;
	assert(nodeptr != NULL);
	newElement = (IXML_Element *)malloc(sizeof (IXML_Element));
	if (newElement == NULL) {
		return NULL;
	}
	ixmlElement_init(newElement);
	rc = ixmlElement_setTagName(newElement, nodeptr->tagName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	elementNode = (IXML_Node *)newElement;
	srcNode = (IXML_Node *)nodeptr;
	rc = ixmlNode_setNodeName(elementNode, srcNode->nodeName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	rc = ixmlNode_setNodeValue(elementNode, srcNode->nodeValue);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	rc = ixmlNode_setNamespaceURI(elementNode, srcNode->namespaceURI);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	rc = ixmlNode_setPrefix(elementNode, srcNode->prefix);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	rc = ixmlNode_setLocalName(elementNode, srcNode->localName);
	if (rc != IXML_SUCCESS) {
		ixmlElement_free(newElement);
		return NULL;
	}
	elementNode->nodeType = eELEMENT_NODE;
	return newElement;
}
static IXML_Element * ixmlNode_cloneElement ( IXML_Element * nodeptr ) { IXML_Element * newElement ; IXML_Node * elementNode ; IXML_Node * srcNode ; int rc ; assert ( nodeptr != NULL ) ; newElement = ( IXML_Element * ) malloc ( sizeof ( IXML_Element ) ) ; if ( newElement == NULL ) { return NULL ; } ixmlElement_init ( newElement ) ; rc = ixmlElement_setTagName ( newElement , nodeptr -> tagName ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } elementNode = ( IXML_Node * ) newElement ; srcNode = ( IXML_Node * ) nodeptr ; rc = ixmlNode_setNodeName ( elementNode , srcNode -> nodeName ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } rc = ixmlNode_setNodeValue ( elementNode , srcNode -> nodeValue ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } rc = ixmlNode_setNamespaceURI ( elementNode , srcNode -> namespaceURI ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } rc = ixmlNode_setPrefix ( elementNode , srcNode -> prefix ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } rc = ixmlNode_setLocalName ( elementNode , srcNode -> localName ) ; if ( rc != IXML_SUCCESS ) { ixmlElement_free ( newElement ) ; return NULL ; } elementNode -> nodeType = eELEMENT_NODE ; return newElement ; }
\brief Returns a clone of element node.
\ brief Returns a clone of element node .
/*! [in] The \b Node to clone. */