Changed the XPath "." to resolve only on the first level for XML Schema
* pattern.c: Changed the XPath "." to resolve only on the first
level for XML Schema IDCs. This should not affect pattern-like
resolution on every level.
diff --git a/ChangeLog b/ChangeLog
index 7f6001f..a48b16a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon May 9 17:56:58 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
+
+ * pattern.c: Changed the XPath "." to resolve only on the first
+ level for XML Schema IDCs. This should not affect pattern-like
+ resolution on every level.
+
Sun May 8 13:35:39 CEST 2005 Daniel Veillard <daniel@veillard.com>
* xmlmemory.c: fixed #169630 segfault in xmlMemDisplay
diff --git a/pattern.c b/pattern.c
index 4e31c3a..ca0580f 100644
--- a/pattern.c
+++ b/pattern.c
@@ -1582,8 +1582,17 @@
* Fast check for ".".
*/
if (comp->nbStep == 0) {
- if (nodeType == XML_ELEMENT_NODE)
- ret = 1;
+ /*
+ * For non-pattern like evaluation like XML Schema IDCs,
+ * this will match if we are at the first level only,
+ * otherwise on every level.
+ */
+ if ((nodeType == XML_ELEMENT_NODE) &&
+ (((stream->flags & XML_PATTERN_NOTPATTERN) == 0) ||
+ (stream->level == 0))) {
+ ret = 1;
+ }
+ stream->level++;
goto stream_next;
}