Return-Path: Delivered-To: apmail-axis-c-dev-archive@www.apache.org Received: (qmail 889 invoked from network); 13 Jan 2011 20:58:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2011 20:58:08 -0000 Received: (qmail 67657 invoked by uid 500); 13 Jan 2011 20:58:08 -0000 Delivered-To: apmail-axis-c-dev-archive@axis.apache.org Received: (qmail 67555 invoked by uid 500); 13 Jan 2011 20:58:07 -0000 Mailing-List: contact c-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list c-dev@axis.apache.org Received: (qmail 67534 invoked by uid 99); 13 Jan 2011 20:58:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 20:58:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 20:58:07 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0DKvkcU000528 for ; Thu, 13 Jan 2011 20:57:47 GMT Message-ID: <304866.352611294952266729.JavaMail.jira@thor> Date: Thu, 13 Jan 2011 15:57:46 -0500 (EST) From: "Aleksey Mokhonko (JIRA)" To: c-dev@axis.apache.org Subject: [jira] Created: (AXIS2C-1528) axiom_util_get_first_child_element_with_localname() returns wrong child_node if a sibling is present and the first node does not match MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 axiom_util_get_first_child_element_with_localname() returns wrong child_node if a sibling is present and the first node does not match -------------------------------------------------------------------------------------------------------------------------------------- Key: AXIS2C-1528 URL: https://issues.apache.org/jira/browse/AXIS2C-1528 Project: Axis2-C Issue Type: Bug Components: util Affects Versions: 1.6.0 Environment: Linux Reporter: Aleksey Mokhonko Bug is obvious. I just show what to fix. File: om_util.c Routine: axiom_util_get_first_child_element_with_localname_attr() Line: 830 Present: if (om_attr_name && NULL != om_attr_value && axutil_strcmp(om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, attr_value) == 0) { *child_node = child; /* <-------------------------------- !!!!!!!!!!!!!!!! */ return om_ele; } Must be: if (om_attr_name && NULL != om_attr_value && axutil_strcmp(om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, attr_value) == 0) { *child_node = next_sibling; /* <-------------------------------- !!!!!!!!!!!!!!!! */ return om_ele; } =============================================== More detailed: =============================================== next_sibling = axiom_node_get_next_sibling(child, env); while (next_sibling) { if (axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) { om_ele = (axiom_element_t *) axiom_node_get_data_element(next_sibling, env); if (om_ele) { child_localname = axiom_element_get_localname(om_ele, env); if (child_localname && axutil_strcmp(child_localname, localname) == 0) { attr_ht = axiom_element_get_all_attributes(om_ele, env); if (attr_ht) { for (hi = axutil_hash_first(attr_ht, env); hi; hi = axutil_hash_next(env, hi)) { void *val = NULL; axutil_hash_this(hi, NULL, NULL, &val); if (val) { om_attr = (axiom_attribute_t *) val; om_attr_name = axiom_attribute_get_localname(om_attr, env); om_attr_value = axiom_attribute_get_value(om_attr, env); if (om_attr_name && NULL != om_attr_value && axutil_strcmp(om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, attr_value) == 0) { *child_node = next_sibling; /* !!!!!!!!!!!!!!!! */ <----------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!! return om_ele; } om_attr = NULL; om_attr_name = NULL; om_attr_value = NULL; } } } } } om_ele = NULL; child_localname = NULL; } next_sibling = axiom_node_get_next_sibling(next_sibling, env); } return NULL; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org For additional commands, e-mail: c-dev-help@axis.apache.org