Skip to content

Commit 2bbb82e

Browse files
authored
Merge pull request #42 from lightpanda-io/get_attribute_null_namespace
When namespace is NULL, match attributes by name only
2 parents 6d02131 + 0f4643f commit 2bbb82e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/core/element.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,10 @@ static dom_attr_list * _dom_element_attr_list_find_by_name(
204204
return NULL;
205205

206206
do {
207-
if (((namespace == NULL && attr->namespace == NULL) ||
208-
(namespace != NULL && attr->namespace != NULL &&
209-
dom_string_isequal(namespace,
210-
attr->namespace))) &&
211-
dom_string_isequal(name, attr->name)) {
207+
if ((namespace == NULL || (
208+
(attr->namespace != NULL && dom_string_isequal(namespace, attr->namespace)))) &&
209+
dom_string_isequal(name, attr->name)
210+
) {
212211
/* Both have NULL namespace or matching namespace,
213212
* and both have same name */
214213
return attr;

0 commit comments

Comments
 (0)