fixed bug #310264, basically it's about reentrancy of count based

* xmlregexp.c: fixed bug #310264, basically it's about reentrancy
  of count based transition, when going though the counter must
  be reset to 0
* test/schemas/bug310264* result/schemas/bug310264*: added the
  regression test.
Daniel
diff --git a/xmlregexp.c b/xmlregexp.c
index 4105599..700b886 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -38,7 +38,7 @@
 #endif
 
 /* #define DEBUG_REGEXP_GRAPH */
-/* #define DEBUG_REGEXP_EXEC */ 
+/* #define DEBUG_REGEXP_EXEC */
 /* #define DEBUG_PUSH */
 /* #define DEBUG_COMPACTION */
 
@@ -2579,6 +2579,14 @@
 #endif
 		    exec->counts[trans->counter]++;
 		}
+		if ((trans->count >= 0) &&
+		    (trans->count < REGEXP_ALL_COUNTER)) {
+#ifdef DEBUG_REGEXP_EXEC
+		    printf("resetting count %d on transition\n",
+		           trans->count);
+#endif
+		    exec->counts[trans->count] = 0;
+		}
 #ifdef DEBUG_REGEXP_EXEC
 		printf("entering state %d\n", trans->to);
 #endif
@@ -3146,6 +3154,14 @@
 #endif
 		    exec->counts[trans->counter]++;
 		}
+		if ((trans->count >= 0) &&
+		    (trans->count < REGEXP_ALL_COUNTER)) {
+#ifdef DEBUG_REGEXP_EXEC
+		    printf("resetting count %d on transition\n",
+		           trans->count);
+#endif
+		    exec->counts[trans->count] = 0;
+		}
 #ifdef DEBUG_PUSH
 		printf("entering state %d\n", trans->to);
 #endif