adding namespace checkings while making sure they still parse as

* parser.c parserInternals.c tree.c include/libxml/parser.h
  include/libxml/xmlerror.h: adding namespace checkings
  while making sure they still parse as wellformed documents.
  Add an nsWellFormed status report to the context, and
  provide new appropriate error codes.
* Makefile.am result/namespaces/* test/namespaces/*: add
  specific regression testing for the new namespace support
* test/att5 result/noent/att5 result/att5 result/att5.sax:
  add more coverage for the attribute parsing and normalization
  code.
Daniel
diff --git a/test/att5 b/test/att5
new file mode 100644
index 0000000..2c05105
--- /dev/null
+++ b/test/att5
@@ -0,0 +1,73 @@
+<!DOCTYPE doc [<!ATTLIST normId attr NMTOKENS #IMPLIED>]>
+<doc>
+  <!-- no normalization -->
+  <norm attr='   '/>
+  <norm attr='
+  foo bar   '/>
+  <norm attr='
+
+foobar'/>
+  <norm attr=' foo bar
+'/>
+  <norm attr='foobar
+
+'/>
+  <norm attr=' &amp; '/>
+  <norm attr='
+  foo&amp;bar   '/>
+  <norm attr='
+
+foobar&amp;'/>
+  <norm attr='&amp;foo bar
+'/>
+  <norm attr='foobar
+
+&amp;'/>
+  <norm attr=' &lt; '/>
+  <norm attr='
+  foo&lt;bar   '/>
+  <norm attr='
+
+foobar&lt;'/>
+  <norm attr='&lt;foo bar
+'/>
+  <norm attr='foobar
+
+&lt;'/>
+  <norm attr=' &#x20;&#13;&#xa;&#9; '/>
+  <!-- normalization -->
+  <normId attr='   '/>
+  <normId attr='
+  foo bar   '/>
+  <normId attr='
+
+foobar'/>
+  <normId attr=' foo bar
+'/>
+  <normId attr='foobar
+
+'/>
+  <normId attr=' &amp; '/>
+  <normId attr='
+  foo&amp;bar   '/>
+  <normId attr='
+
+foobar&amp;'/>
+  <normId attr='&amp;foo bar
+'/>
+  <normId attr='foobar
+
+&amp;'/>
+  <normId attr=' &lt; '/>
+  <normId attr='
+  foo&lt;bar   '/>
+  <normId attr='
+
+foobar&lt;'/>
+  <normId attr='&lt;foo bar
+'/>
+  <normId attr='foobar
+
+&lt;'/>
+  <normId attr=' &#13;&#xa;&#9; '/> <!-- PBM serializing back -->
+</doc>
diff --git a/test/namespaces/err_0.xml b/test/namespaces/err_0.xml
new file mode 100644
index 0000000..50bdd32
--- /dev/null
+++ b/test/namespaces/err_0.xml
@@ -0,0 +1 @@
+<foo xmlnsbar="1"/>
diff --git a/test/namespaces/err_1.xml b/test/namespaces/err_1.xml
new file mode 100644
index 0000000..eb6f43b
--- /dev/null
+++ b/test/namespaces/err_1.xml
@@ -0,0 +1 @@
+<foo xmlns:="http://example.com/"/>
diff --git a/test/namespaces/err_2.xml b/test/namespaces/err_2.xml
new file mode 100644
index 0000000..9fd51b3
--- /dev/null
+++ b/test/namespaces/err_2.xml
@@ -0,0 +1 @@
+<:/>
diff --git a/test/namespaces/err_3.xml b/test/namespaces/err_3.xml
new file mode 100644
index 0000000..3d4d439
--- /dev/null
+++ b/test/namespaces/err_3.xml
@@ -0,0 +1 @@
+<:foo/>
diff --git a/test/namespaces/err_4.xml b/test/namespaces/err_4.xml
new file mode 100644
index 0000000..9dc294e
--- /dev/null
+++ b/test/namespaces/err_4.xml
@@ -0,0 +1 @@
+<f: xmlns:f="http://example.com/foo"/>
diff --git a/test/namespaces/err_5.xml b/test/namespaces/err_5.xml
new file mode 100644
index 0000000..5943c11
--- /dev/null
+++ b/test/namespaces/err_5.xml
@@ -0,0 +1 @@
+<f:a: xmlns:f="http://example.com/foo"/>
diff --git a/test/namespaces/err_6.xml b/test/namespaces/err_6.xml
new file mode 100644
index 0000000..e3eb3b2
--- /dev/null
+++ b/test/namespaces/err_6.xml
@@ -0,0 +1 @@
+<f:a:b xmlns:f="http://example.com/foo"/>
diff --git a/test/namespaces/err_7.xml b/test/namespaces/err_7.xml
new file mode 100644
index 0000000..5bbe235
--- /dev/null
+++ b/test/namespaces/err_7.xml
@@ -0,0 +1 @@
+<f:foo/>
diff --git a/test/namespaces/err_8.xml b/test/namespaces/err_8.xml
new file mode 100644
index 0000000..8321da2
--- /dev/null
+++ b/test/namespaces/err_8.xml
@@ -0,0 +1 @@
+<tst xmlns:xml="http://example.com/"/>
diff --git a/test/namespaces/err_9.xml b/test/namespaces/err_9.xml
new file mode 100644
index 0000000..4478c60
--- /dev/null
+++ b/test/namespaces/err_9.xml
@@ -0,0 +1,2 @@
+<tst xmlns:a="http://example.com/" xmlns:b="http://example.com/"
+     a:err="1" b:err="2"/>