ixml/src/node.c
static IXML_Attr *ixmlNode_cloneAttr(
	/*! [in] The \b Node to clone. */
	IXML_Attr *nodeptr)
{
	IXML_Attr *newAttr;
	IXML_Node *attrNode;
	IXML_Node *srcNode;
	int rc;

	assert(nodeptr != NULL);

	newAttr = (IXML_Attr *)malloc(sizeof (IXML_Attr));
	if (newAttr == NULL) {
		return NULL;
	}

	ixmlAttr_init(newAttr);
	attrNode = (IXML_Node *)newAttr;
	srcNode = (IXML_Node *)nodeptr;

	rc = ixmlNode_setNodeName(attrNode, srcNode->nodeName);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}

	rc = ixmlNode_setNodeValue(attrNode, srcNode->nodeValue);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}

	/* Check to see whether we need to split prefix and localname for attribute */
	rc = ixmlNode_setNamespaceURI(attrNode, srcNode->namespaceURI);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}

	rc = ixmlNode_setPrefix(attrNode, srcNode->prefix);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}

	rc = ixmlNode_setLocalName(attrNode, srcNode->localName);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}

	attrNode->nodeType = eATTRIBUTE_NODE;

	return newAttr;
}
/*!
 * \brief Returns a clone of an attribute node.
 *
 * \return A clone of an attribute node.
 */
\brief Returns a clone of an attribute node.
\return A clone of an attribute node.
\ brief Returns a clone of an attribute node . \ return A clone of an attribute node .
static IXML_Attr *ixmlNode_cloneAttr(
	IXML_Attr *nodeptr)
{
	IXML_Attr *newAttr;
	IXML_Node *attrNode;
	IXML_Node *srcNode;
	int rc;
	assert(nodeptr != NULL);
	newAttr = (IXML_Attr *)malloc(sizeof (IXML_Attr));
	if (newAttr == NULL) {
		return NULL;
	}
	ixmlAttr_init(newAttr);
	attrNode = (IXML_Node *)newAttr;
	srcNode = (IXML_Node *)nodeptr;
	rc = ixmlNode_setNodeName(attrNode, srcNode->nodeName);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}
	rc = ixmlNode_setNodeValue(attrNode, srcNode->nodeValue);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}
	rc = ixmlNode_setNamespaceURI(attrNode, srcNode->namespaceURI);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}
	rc = ixmlNode_setPrefix(attrNode, srcNode->prefix);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}
	rc = ixmlNode_setLocalName(attrNode, srcNode->localName);
	if (rc != IXML_SUCCESS) {
		ixmlAttr_free(newAttr);
		return NULL;
	}
	attrNode->nodeType = eATTRIBUTE_NODE;
	return newAttr;
}
static IXML_Attr * ixmlNode_cloneAttr ( IXML_Attr * nodeptr ) { IXML_Attr * newAttr ; IXML_Node * attrNode ; IXML_Node * srcNode ; int rc ; assert ( nodeptr != NULL ) ; newAttr = ( IXML_Attr * ) malloc ( sizeof ( IXML_Attr ) ) ; if ( newAttr == NULL ) { return NULL ; } ixmlAttr_init ( newAttr ) ; attrNode = ( IXML_Node * ) newAttr ; srcNode = ( IXML_Node * ) nodeptr ; rc = ixmlNode_setNodeName ( attrNode , srcNode -> nodeName ) ; if ( rc != IXML_SUCCESS ) { ixmlAttr_free ( newAttr ) ; return NULL ; } rc = ixmlNode_setNodeValue ( attrNode , srcNode -> nodeValue ) ; if ( rc != IXML_SUCCESS ) { ixmlAttr_free ( newAttr ) ; return NULL ; } rc = ixmlNode_setNamespaceURI ( attrNode , srcNode -> namespaceURI ) ; if ( rc != IXML_SUCCESS ) { ixmlAttr_free ( newAttr ) ; return NULL ; } rc = ixmlNode_setPrefix ( attrNode , srcNode -> prefix ) ; if ( rc != IXML_SUCCESS ) { ixmlAttr_free ( newAttr ) ; return NULL ; } rc = ixmlNode_setLocalName ( attrNode , srcNode -> localName ) ; if ( rc != IXML_SUCCESS ) { ixmlAttr_free ( newAttr ) ; return NULL ; } attrNode -> nodeType = eATTRIBUTE_NODE ; return newAttr ; }
\brief Returns a clone of an attribute node.
\ brief Returns a clone of an attribute node .
/*! [in] The \b Node to clone. */ /* Check to see whether we need to split prefix and localname for attribute */