fixed xmlSetProp and al. when the node passed is not an element. fixed

* tree.c: fixed xmlSetProp and al. when the node passed is not an
  element.
* relaxng.c: fixed bugs 7.3 (though not complete) and memory leaks
  found 373 test schemas: 369 success 4 failures
  found 529 test instances: 525 success 4 failures
* check-relaxng-test-suite.py: added memory debug reporting
Daniel
diff --git a/check-relaxng-test-suite.py b/check-relaxng-test-suite.py
index 5363a81..6f65264 100755
--- a/check-relaxng-test-suite.py
+++ b/check-relaxng-test-suite.py
@@ -7,6 +7,8 @@
 sys.path.append("python")
 import libxml2
 
+# Memory debug specific
+libxml2.debugMemory(1)
 debug = 0
 
 #
@@ -97,6 +99,7 @@
 	nb_instances_failed = nb_instances_failed + 1
     else:
 	nb_instances_success = nb_instances_success + 1
+    doc.freeDoc()
 
 #
 # handle an invalid instance
@@ -136,6 +139,7 @@
 	nb_instances_failed = nb_instances_failed + 1
     else:
 	nb_instances_success = nb_instances_success + 1
+    doc.freeDoc()
 
 #
 # handle an incorrect test
@@ -364,3 +368,14 @@
       nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
 print "found %d test instances: %d success %d failures" % (
       nb_instances_tests, nb_instances_success, nb_instances_failed)
+
+testsuite.freeDoc()
+
+# Memory debug specific
+libxml2.relaxNGCleanupTypes()
+libxml2.cleanupParser()
+if libxml2.debugMemory(1) == 0:
+    print "OK"
+else:
+    print "Memory leak %d bytes" % (libxml2.debugMemory(1))
+    libxml2.dumpMemory()