summaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
Diffstat (limited to 'pattern.c')
-rw-r--r--pattern.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/pattern.c b/pattern.c
index a76a58c5..f65c6153 100644
--- a/pattern.c
+++ b/pattern.c
@@ -1710,9 +1710,14 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream,
/*
* Check for correct node-type.
*/
- if ((nodeType == XML_ATTRIBUTE_NODE) &&
- ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0))
- goto next_state;
+ if (nodeType == XML_ELEMENT_NODE) {
+ if (comp->steps[step].flags & XML_STREAM_STEP_ATTR)
+ goto next_state;
+
+ } else if (nodeType == XML_ATTRIBUTE_NODE) {
+ if ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0)
+ goto next_state;
+ }
/*
* Compare local/namespace-name.
*/
@@ -1816,9 +1821,14 @@ compare:
/*
* Check expected node-type.
*/
- if ((nodeType == XML_ATTRIBUTE_NODE) &&
- ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0))
- goto stream_next;
+ if (nodeType == XML_ELEMENT_NODE) {
+ if (comp->steps[0].flags & XML_STREAM_STEP_ATTR)
+ goto stream_next;
+
+ } else if (nodeType == XML_ATTRIBUTE_NODE) {
+ if ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0)
+ goto stream_next;
+ }
/*
* Compare local/namespace-name.
*/