예제 #1
0
파일: element.c 프로젝트: maojxsir/upnp
/*================================================================
*   ixmlElement_findAttributeNode
*       Find a attribute node whose contents are the same as the oldAttr.
*       Internal only to parser.
*   Parameter:
*       oldAttr: the attribute node to match
*   Return:
*       if found it, the attribute node is returned,
*       otherwise, return NULL.
*
*=================================================================*/
IXML_Node *
ixmlElement_findAttributeNode( IN IXML_Element * element,
                               IN IXML_Attr * oldAttr )
{
    IXML_Node *attrNode;
    IXML_Node *oldAttrNode = ( IXML_Node * ) oldAttr;
    ixml_assert( ( element != NULL ) && ( oldAttr != NULL ) );

    attrNode = element->n.firstAttr;
    while( attrNode != NULL ) { // parentNode, prevSib, nextSib and ownerDocument doesn't matter
        if( ixmlNode_compare( attrNode, oldAttrNode ) == TRUE ) {
            break;              //found it
        } else {
            attrNode = attrNode->nextSibling;
        }
    }

    return attrNode;

}
예제 #2
0
/*!
 * \brief Find a attribute node whose contents are the same as the oldAttr.
 *
 * \return If found, the attribute node is returned, otherwise \b NULL is
 * returned.
 */
static IXML_Node *ixmlElement_findAttributeNode(
	/*! [in] The element to search for the attribute. */
	IXML_Element *element,
	/*! [in] The attribute node to match. */
	IXML_Attr *oldAttr)
{
	IXML_Node *attrNode;
	IXML_Node *oldAttrNode = (IXML_Node *)oldAttr;

	assert(element != NULL && oldAttr != NULL);

	attrNode = element->n.firstAttr;
	while (attrNode != NULL) {
		/* parentNode, prevSib, nextSib and ownerDocument doesn't matter */
		if (ixmlNode_compare(attrNode, oldAttrNode) == TRUE) {
			/* Found it */
			break;
		} else {
			attrNode = attrNode->nextSibling;
		}
	}

	return attrNode;
}