libxml2 r3738 - in trunk: . doc doc/devhelp doc/html include/libxml python win32



Author: veillard
Date: Fri Apr 11 13:58:43 2008
New Revision: 3738
URL: http://svn.gnome.org/viewvc/libxml2?rev=3738&view=rev

Log:
* include/libxml/xmlschemas.h xmlschemas.c: added new function
  xmlSchemaValidCtxtGetParserCtxt based on Holger Kaelberer patch
* doc/apibuild.py doc/*: regenerated the doc, chased why the new
  function didn't got any documentation, added more checking in the
  generator
* include/libxml/relaxng.h include/libxml/schematron.h
  include/libxml/xmlschemas.h include/libxml/c14n.h
  include/libxml/xmlregexp.h include/libxml/globals.h
  include/libxml/xmlreader.h threads.c xmlschemas.c: various changes
  and cleanups following the new reports
Daniel


Modified:
   trunk/ChangeLog
   trunk/doc/APIconstructors.html
   trunk/doc/APIfiles.html
   trunk/doc/APIfunctions.html
   trunk/doc/APIsymbols.html
   trunk/doc/apibuild.py
   trunk/doc/devhelp/libxml2-c14n.html
   trunk/doc/devhelp/libxml2-globals.html
   trunk/doc/devhelp/libxml2-relaxng.html
   trunk/doc/devhelp/libxml2-schematron.html
   trunk/doc/devhelp/libxml2-xmlreader.html
   trunk/doc/devhelp/libxml2-xmlregexp.html
   trunk/doc/devhelp/libxml2-xmlschemas.html
   trunk/doc/devhelp/libxml2.devhelp
   trunk/doc/html/libxml-xmlschemas.html
   trunk/doc/libxml2-api.xml
   trunk/doc/libxml2-refs.xml
   trunk/elfgcchack.h
   trunk/include/libxml/c14n.h
   trunk/include/libxml/globals.h
   trunk/include/libxml/relaxng.h
   trunk/include/libxml/schematron.h
   trunk/include/libxml/xmlreader.h
   trunk/include/libxml/xmlregexp.h
   trunk/include/libxml/xmlschemas.h
   trunk/python/libxml2class.txt
   trunk/testapi.c
   trunk/threads.c
   trunk/win32/libxml2.def.src
   trunk/xmlschemas.c

Modified: trunk/doc/APIconstructors.html
==============================================================================
--- trunk/doc/APIconstructors.html	(original)
+++ trunk/doc/APIconstructors.html	Fri Apr 11 13:58:43 2008
@@ -447,6 +447,7 @@
 <a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
 <a href="html/libxml-parserInternals.html#xmlCreateURLParserCtxt">xmlCreateURLParserCtxt</a><br />
 <a href="html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
 </p><h2>Type xmlParserErrors:</h2><p><a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
 </p><h2>Type xmlParserInputBufferCreateFilenameFunc:</h2><p><a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a><br />
 <a href="html/libxml-globals.html#xmlThrDefParserInputBufferCreateFilenameDefault">xmlThrDefParserInputBufferCreateFilenameDefault</a><br />

Modified: trunk/doc/APIfiles.html
==============================================================================
--- trunk/doc/APIfiles.html	(original)
+++ trunk/doc/APIfiles.html	Fri Apr 11 13:58:43 2008
@@ -2849,6 +2849,7 @@
 <a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />

Modified: trunk/doc/APIfunctions.html
==============================================================================
--- trunk/doc/APIfunctions.html	(original)
+++ trunk/doc/APIfunctions.html	Fri Apr 11 13:58:43 2008
@@ -1934,6 +1934,7 @@
 <a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />

Modified: trunk/doc/APIsymbols.html
==============================================================================
--- trunk/doc/APIsymbols.html	(original)
+++ trunk/doc/APIsymbols.html	Fri Apr 11 13:58:43 2008
@@ -2747,6 +2747,7 @@
 <a href="html/libxml-schemasInternals.html#xmlSchemaValType">xmlSchemaValType</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />

Modified: trunk/doc/apibuild.py
==============================================================================
--- trunk/doc/apibuild.py	(original)
+++ trunk/doc/apibuild.py	Fri Apr 11 13:58:43 2008
@@ -356,7 +356,7 @@
 	self.analyze_dict("structs", self.structs)
 	self.analyze_dict("typedefs", self.typedefs)
 	self.analyze_dict("macros", self.macros)
-         
+
 class CLexer:
     """A lexer for the C language, tokenize the input by reading and
        analyzing it line by line"""
@@ -388,7 +388,7 @@
 		else:
 		    line = line + n
         return line
-	 
+
     def getlineno(self):
         return self.lineno
 
@@ -557,12 +557,12 @@
 		    else:
 		        break
 		self.tokens.append(('name', line[s:i]))
-             
+
 	tok = self.tokens[0]
 	self.tokens = self.tokens[1:]
 	self.last = tok
 	return tok
-      
+
 class CParser:
     """The C module parser"""
     def __init__(self, filename, idx = None):
@@ -717,7 +717,7 @@
 	    l = string.strip(l)
 	    desc = desc + " " + l
 	    del lines[0]
-		     
+
 	desc = string.strip(desc)
 
 	if quiet == 0:
@@ -787,7 +787,7 @@
 	    l = string.strip(l)
 	    desc = desc + " " + l
 	    del lines[0]
-		     
+
 	desc = string.strip(desc)
 
 	if quiet == 0:
@@ -888,7 +888,7 @@
 	    else:
 	        desc = desc + " " + l
 		del lines[0]
-		     
+
 	retdesc = string.strip(retdesc)
 	desc = string.strip(desc)
 
@@ -898,7 +898,8 @@
 	     #
 	    i = 0
 	    while i < nbargs:
-	        if args[i][2] == None and args[i][0] != "void" and args[i][1] != None:
+	        if args[i][2] == None and args[i][0] != "void" and \
+		   ((args[i][1] != None) or (args[i][1] == '')):
 		    self.warning("Function comment for %s lacks description of arg %s" % (name, args[i][1]))
 		i = i + 1
 	    if retdesc == "" and ret[0] != "void":
@@ -906,7 +907,6 @@
 	    if desc == "":
 	        self.warning("Function comment for %s lacks description of the function" % (name))
 
-
 	return(((ret[0], retdesc), args, desc))
 
     def parsePreproc(self, token):
@@ -966,7 +966,7 @@
 	    try:
 	        self.defines.append(apstr)
 		if string.find(apstr, 'ENABLED') != -1:
-		    self.conditionals.append("defined(%s)" % apstr)    
+		    self.conditionals.append("defined(%s)" % apstr)
 	    except:
 	        pass
 	elif name == "#ifndef":
@@ -974,7 +974,7 @@
 	    try:
 	        self.defines.append(apstr)
 		if string.find(apstr, 'ENABLED') != -1:
-		    self.conditionals.append("!defined(%s)" % apstr)    
+		    self.conditionals.append("!defined(%s)" % apstr)
 	    except:
 	        pass
 	elif name == "#if":
@@ -1096,7 +1096,7 @@
 		return token
 	token = self.token()
 	return token
-	     
+
      #
      # Parse a C code block, used for functions it parse till
      # the balancing } included
@@ -1131,7 +1131,7 @@
 		    elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXML_":
 			self.index_add_ref(oldtok[1], self.filename,
 					    0, "typedef")
-			 
+
 		else:
 		    token = self.token()
 	return token
@@ -1264,7 +1264,7 @@
 	if token == None:
 	    return token
 
-	while token[0] == "name" and ( 
+	while token[0] == "name" and (
 	      token[1] == "const" or \
 	      token[1] == "unsigned" or \
 	      token[1] == "signed"):
@@ -1284,7 +1284,7 @@
 		    self.type = tmp[1]
 		else:
 		    self.type = self.type + " " + tmp[1]
-	     
+
         elif token[0] == "name" and token[1] == "struct":
 	    if self.type == "":
 	        self.type = token[1]
@@ -1574,7 +1574,7 @@
 			token = self.token()
 		else:
 		    break
-		    
+
 	return token
 
     def parse(self):
@@ -1590,7 +1590,7 @@
 		return
 	self.parseTopComment(self.top_comment)
         return self.index
-	         
+
 
 class docBuilder:
     """A documentation builder"""
@@ -1687,7 +1687,7 @@
 		    self.headers[file] = None;
 	self.scanHeaders()
 	self.scanModules()
-         
+
     def modulename_file(self, file):
         module = os.path.basename(file)
 	if module[-2:] == '.h':
@@ -1781,7 +1781,7 @@
 	else:
 	    output.write("    <variable name='%s' file='%s'/>\n" % (
 	            name, self.modulename_file(id.header)))
-	              
+
     def serialize_function(self, output, name):
         id = self.idx.functions[name]
 	if name == debugsym:
@@ -1802,6 +1802,11 @@
 	    output.write("      <cond>%s</cond>\n"% (apstr));
 	try:
 	    (ret, params, desc) = id.info
+	    if (desc == None or desc == '') and \
+	       name[0:9] != "xmlThrDef" and name != "xmlDllMain":
+	        print "%s %s from %s has no description" % (id.type, name,
+		       self.modulename_file(id.module))
+
 	    output.write("      <info>%s</info>\n" % (escape(desc)))
 	    self.indexString(name, desc)
 	    if ret[0] != None:

Modified: trunk/doc/devhelp/libxml2-c14n.html
==============================================================================
--- trunk/doc/devhelp/libxml2-c14n.html	(original)
+++ trunk/doc/devhelp/libxml2-c14n.html	Fri Apr 11 13:58:43 2008
@@ -57,8 +57,8 @@
       <h2>Details</h2>
       <div class="refsect2" lang="en">
         <div class="refsect2" lang="en"><h3><a name="xmlC14NIsVisibleCallback"/>Function type xmlC14NIsVisibleCallback</h3><pre class="programlisting">int	xmlC14NIsVisibleCallback	(void * user_data, <br/>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br/>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> parent)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for a C14N callback on visible nodes</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>user data</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the curent node</td></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td>the parent node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node should be included</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlC14NDocDumpMemory"/>xmlC14NDocDumpMemory ()</h3><pre class="programlisting">int	xmlC14NDocDumpMemory		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>					 <a href="libxml2-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes, <br/>					 int exclusive, <br/>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** inclusive_ns_prefixes, <br/>					 int with_comments, <br/>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** doc_txt_ptr)<br/>
 </pre><p>Dumps the canonized image of given XML document into memory. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p>

Modified: trunk/doc/devhelp/libxml2-globals.html
==============================================================================
--- trunk/doc/devhelp/libxml2-globals.html	(original)
+++ trunk/doc/devhelp/libxml2-globals.html	Fri Apr 11 13:58:43 2008
@@ -125,20 +125,20 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlDeregisterNodeFunc"/>Function type xmlDeregisterNodeFunc</h3><pre class="programlisting">void	xmlDeregisterNodeFunc		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the deregistration callback of a discarded node</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlOutputBufferCreateFilenameFunc"/>Function type xmlOutputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateFilenameFunc	(const char * URI, <br/>							 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder, <br/>							 int compression)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to write to</td></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParserInputBufferCreateFilenameFunc"/>Function type xmlParserInputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateFilenameFunc	(const char * URI, <br/>							 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to read from</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>the requested source encoding</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegisterNodeFunc"/>Function type xmlRegisterNodeFunc</h3><pre class="programlisting">void	xmlRegisterNodeFunc		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the registration callback of a created node</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="docbDefaultSAXHandler">Variable </a>docbDefaultSAXHandler</h3><pre class="programlisting"><a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> docbDefaultSAXHandler;
 </pre><p/>

Modified: trunk/doc/devhelp/libxml2-relaxng.html
==============================================================================
--- trunk/doc/devhelp/libxml2-relaxng.html	(original)
+++ trunk/doc/devhelp/libxml2-relaxng.html	Fri Apr 11 13:58:43 2008
@@ -169,12 +169,12 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityErrorFunc"/>Function type xmlRelaxNGValidityErrorFunc</h3><pre class="programlisting">void	xmlRelaxNGValidityErrorFunc	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from a Relax-NG validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityWarningFunc"/>Function type xmlRelaxNGValidityWarningFunc</h3><pre class="programlisting">void	xmlRelaxNGValidityWarningFunc	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of a warning callback from a Relax-NG validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGCleanupTypes"/>xmlRelaxNGCleanupTypes ()</h3><pre class="programlisting">void	xmlRelaxNGCleanupTypes		(void)<br/>
 </pre><p>Cleanup the default Schemas type library associated to RelaxNG</p>

Modified: trunk/doc/devhelp/libxml2-schematron.html
==============================================================================
--- trunk/doc/devhelp/libxml2-schematron.html	(original)
+++ trunk/doc/devhelp/libxml2-schematron.html	Fri Apr 11 13:58:43 2008
@@ -113,12 +113,12 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchematronValidityErrorFunc"/>Function type xmlSchematronValidityErrorFunc</h3><pre class="programlisting">void	xmlSchematronValidityErrorFunc	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from a Schematron validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchematronValidityWarningFunc"/>Function type xmlSchematronValidityWarningFunc</h3><pre class="programlisting">void	xmlSchematronValidityWarningFunc	(void * ctx, <br/>						 const char * msg, <br/>						 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of a warning callback from a Schematron validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchematronFree"/>xmlSchematronFree ()</h3><pre class="programlisting">void	xmlSchematronFree		(<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema)<br/>
 </pre><p>Deallocate a Schematron structure.</p>

Modified: trunk/doc/devhelp/libxml2-xmlreader.html
==============================================================================
--- trunk/doc/devhelp/libxml2-xmlreader.html	(original)
+++ trunk/doc/devhelp/libxml2-xmlreader.html	Fri Apr 11 13:58:43 2008
@@ -211,8 +211,8 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlTextReaderErrorFunc"/>Function type xmlTextReaderErrorFunc</h3><pre class="programlisting">void	xmlTextReaderErrorFunc		(void * arg, <br/>					 const char * msg, <br/>					 <a href="libxml2-xmlreader.html#xmlParserSeverities">xmlParserSeverities</a> severity, <br/>					 <a href="libxml2-xmlreader.html#xmlTextReaderLocatorPtr">xmlTextReaderLocatorPtr</a> locator)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>severity</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from a reader parser</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>the user argument</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>severity</tt></i>:</span></td><td>the severity of the error</td></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td>a locator indicating where the error occured</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlFreeTextReader"/>xmlFreeTextReader ()</h3><pre class="programlisting">void	xmlFreeTextReader		(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
 </pre><p>Deallocate all the resources associated to the reader</p>

Modified: trunk/doc/devhelp/libxml2-xmlregexp.html
==============================================================================
--- trunk/doc/devhelp/libxml2-xmlregexp.html	(original)
+++ trunk/doc/devhelp/libxml2-xmlregexp.html	Fri Apr 11 13:58:43 2008
@@ -143,8 +143,8 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegExecCallbacks"/>Function type xmlRegExecCallbacks</h3><pre class="programlisting">void	xmlRegExecCallbacks		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * token, <br/>					 void * transdata, <br/>					 void * inputdata)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Callback function when doing a transition in the automata</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>the regular expression context</td></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td>the current token string</td></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td>transition data</td></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td>input data</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="emptyExp">Variable </a>emptyExp</h3><pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> emptyExp;
 </pre><p/>

Modified: trunk/doc/devhelp/libxml2-xmlschemas.html
==============================================================================
--- trunk/doc/devhelp/libxml2-xmlschemas.html	(original)
+++ trunk/doc/devhelp/libxml2-xmlschemas.html	Fri Apr 11 13:58:43 2008
@@ -68,7 +68,7 @@
 void	<a href="#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br/>					 void * ctx);
 int	<a href="#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
 int	<a href="#xmlSchemaValidateFile">xmlSchemaValidateFile</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 const char * filename, <br/>					 int options);
-int	<a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance);
+int	<a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
 void	<a href="#xmlSchemaFree">xmlSchemaFree</a>			(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
 <a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	<a href="#xmlSchemaNewMemParserCtxt">xmlSchemaNewMemParserCtxt</a>	(const char * buffer, <br/>							 int size);
 int	<a href="#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br/>					 void ** ctx);
@@ -77,6 +77,7 @@
 typedef void <a href="#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a>	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...);
 void	<a href="#xmlSchemaDump">xmlSchemaDump</a>			(FILE * output, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
 void	<a href="#xmlSchemaFreeValidCtxt">xmlSchemaFreeValidCtxt</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
 void	<a href="#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br/>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/>						 void * ctx);
 <a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a>	<a href="#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
 </pre>
@@ -185,12 +186,12 @@
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityErrorFunc"/>Function type xmlSchemaValidityErrorFunc</h3><pre class="programlisting">void	xmlSchemaValidityErrorFunc	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from an XSD validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityWarningFunc"/>Function type xmlSchemaValidityWarningFunc</h3><pre class="programlisting">void	xmlSchemaValidityWarningFunc	(void * ctx, <br/>					 const char * msg, <br/>					 ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of a warning callback from an XSD validation</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaDump"/>xmlSchemaDump ()</h3><pre class="programlisting">void	xmlSchemaDump			(FILE * output, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br/>
 </pre><p>Dump a Schema structure.</p>
@@ -205,20 +206,20 @@
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema parser context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaFreeValidCtxt"/>xmlSchemaFreeValidCtxt ()</h3><pre class="programlisting">void	xmlSchemaFreeValidCtxt		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Free the resources associated to the schema validation context</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaGetParserErrors"/>xmlSchemaGetParserErrors ()</h3><pre class="programlisting">int	xmlSchemaGetParserErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br/>					 void ** ctx)<br/>
 </pre><p>Get the callback information used to handle errors for a parser context</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XMl-Schema parser context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaGetValidErrors"/>xmlSchemaGetValidErrors ()</h3><pre class="programlisting">int	xmlSchemaGetValidErrors		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br/>					 void ** ctx)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Get the error and warning callback informations</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XML-Schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaIsValid"/>xmlSchemaIsValid ()</h3><pre class="programlisting">int	xmlSchemaIsValid		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Check if any error was detected during validation.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid so far, 0 if errors were detected, and -1 in case of internal error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaNewDocParserCtxt"/>xmlSchemaNewDocParserCtxt ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	xmlSchemaNewDocParserCtxt	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
 </pre><p>Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.</p>
@@ -233,20 +234,20 @@
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the location of the schema</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaNewValidCtxt"/>xmlSchemaNewValidCtxt ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a>	xmlSchemaNewValidCtxt	(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Create an XML Schemas validation context based on the given schema.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td>a precompiled XML Schemas</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the validation context or NULL in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaParse"/>xmlSchemaParse ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a>	xmlSchemaParse		(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br/>
 </pre><p>parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the internal XML Schema structure built from the resource or NULL in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSAXPlug"/>xmlSchemaSAXPlug ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a>	xmlSchemaSAXPlug	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>						 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> * sax, <br/>						 void ** user_data)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>a pointer to the original <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a></td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>a pointer to the original SAX user data pointer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSAXUnplug"/>xmlSchemaSAXUnplug ()</h3><pre class="programlisting">int	xmlSchemaSAXUnplug		(<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td>a data structure returned by <a href="libxml2-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetParserErrors"/>xmlSchemaSetParserErrors ()</h3><pre class="programlisting">void	xmlSchemaSetParserErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br/>					 void * ctx)<br/>
 </pre><p>Set the callback functions used to handle errors for a validation context</p>
@@ -257,36 +258,40 @@
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidErrors"/>xmlSchemaSetValidErrors ()</h3><pre class="programlisting">void	xmlSchemaSetValidErrors		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br/>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br/>					 void * ctx)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Set the error and warning callback informations</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidOptions"/>xmlSchemaSetValidOptions ()</h3><pre class="programlisting">int	xmlSchemaSetValidOptions	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 int options)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Sets the options to be used during the validation.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a combination of <a href="libxml2-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of an API error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidStructuredErrors"/>xmlSchemaSetValidStructuredErrors ()</h3><pre class="programlisting">void	xmlSchemaSetValidStructuredErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/>						 void * ctx)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Set the structured error callback</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidCtxtGetOptions"/>xmlSchemaValidCtxtGetOptions ()</h3><pre class="programlisting">int	xmlSchemaValidCtxtGetOptions	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Get the validation context options.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the option combination or -1 on error.</td></tr></tbody></table></div></div>
         <hr/>
-        <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateDoc"/>xmlSchemaValidateDoc ()</h3><pre class="programlisting">int	xmlSchemaValidateDoc		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>instance</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+        <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidCtxtGetParserCtxt"/>xmlSchemaValidCtxtGetParserCtxt ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	xmlSchemaValidCtxtGetParserCtxt	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
+</pre><p>allow access to the parser context of the schema validation context</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context of the schema validation context or NULL in case of error.</td></tr></tbody></table></div></div>
+        <hr/>
+        <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateDoc"/>xmlSchemaValidateDoc ()</h3><pre class="programlisting">int	xmlSchemaValidateDoc		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
+</pre><p>Validate a document tree in memory.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a parsed document tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateFile"/>xmlSchemaValidateFile ()</h3><pre class="programlisting">int	xmlSchemaValidateFile		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 const char * filename, <br/>					 int options)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the URI of the instance</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a future set of options, currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateOneElement"/>xmlSchemaValidateOneElement ()</h3><pre class="programlisting">int	xmlSchemaValidateOneElement	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Validate a branch of a tree, starting with the given @elem.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>an element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateStream"/>xmlSchemaValidateStream ()</h3><pre class="programlisting">int	xmlSchemaValidateStream		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br/>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br/>					 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/>					 void * user_data)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>the input to use for reading the data</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>an optional encoding information</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>a SAX handler for the resulting events</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>the context to provide to the SAX handler.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div></div>
         <hr/>
       </div>
     </div>

Modified: trunk/doc/devhelp/libxml2.devhelp
==============================================================================
--- trunk/doc/devhelp/libxml2.devhelp	(original)
+++ trunk/doc/devhelp/libxml2.devhelp	Fri Apr 11 13:58:43 2008
@@ -2835,6 +2835,7 @@
     <function name="xmlSchemaValPredefTypeNode ()" link="libxml2-xmlschemastypes.html#xmlSchemaValPredefTypeNode"/>
     <function name="xmlSchemaValPredefTypeNodeNoNorm ()" link="libxml2-xmlschemastypes.html#xmlSchemaValPredefTypeNodeNoNorm"/>
     <function name="xmlSchemaValidCtxtGetOptions ()" link="libxml2-xmlschemas.html#xmlSchemaValidCtxtGetOptions"/>
+    <function name="xmlSchemaValidCtxtGetParserCtxt ()" link="libxml2-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt"/>
     <function name="xmlSchemaValidateDoc ()" link="libxml2-xmlschemas.html#xmlSchemaValidateDoc"/>
     <function name="xmlSchemaValidateFacet ()" link="libxml2-xmlschemastypes.html#xmlSchemaValidateFacet"/>
     <function name="xmlSchemaValidateFacetWhtsp ()" link="libxml2-xmlschemastypes.html#xmlSchemaValidateFacetWhtsp"/>

Modified: trunk/doc/html/libxml-xmlschemas.html
==============================================================================
--- trunk/doc/html/libxml-xmlschemas.html	(original)
+++ trunk/doc/html/libxml-xmlschemas.html	Fri Apr 11 13:58:43 2008
@@ -43,6 +43,7 @@
 <pre class="programlisting">int	<a href="#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a>	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 int options)</pre>
 <pre class="programlisting">void	<a href="#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a>	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />						 <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br />						 void * ctx)</pre>
 <pre class="programlisting">int	<a href="#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a>	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)</pre>
+<pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a>	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)</pre>
 <pre class="programlisting">int	<a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a>		(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> instance)</pre>
 <pre class="programlisting">int	<a href="#xmlSchemaValidateFile">xmlSchemaValidateFile</a>		(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 const char * filename, <br />					 int options)</pre>
 <pre class="programlisting">int	<a href="#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a>	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)</pre>
@@ -153,6 +154,8 @@
 </pre><p></p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidCtxtGetOptions" id="xmlSchemaValidCtxtGetOptions"></a>Function: xmlSchemaValidCtxtGetOptions</h3><pre class="programlisting">int	xmlSchemaValidCtxtGetOptions	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
 </pre><p></p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidCtxtGetParserCtxt" id="xmlSchemaValidCtxtGetParserCtxt"></a>Function: xmlSchemaValidCtxtGetParserCtxt</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	xmlSchemaValidCtxtGetParserCtxt	(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
+</pre><p></p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateDoc" id="xmlSchemaValidateDoc"></a>Function: xmlSchemaValidateDoc</h3><pre class="programlisting">int	xmlSchemaValidateDoc		(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> instance)<br />
 </pre><p></p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>instance</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateFile" id="xmlSchemaValidateFile"></a>Function: xmlSchemaValidateFile</h3><pre class="programlisting">int	xmlSchemaValidateFile		(<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />					 const char * filename, <br />					 int options)<br />

Modified: trunk/doc/libxml2-api.xml
==============================================================================
--- trunk/doc/libxml2-api.xml	(original)
+++ trunk/doc/libxml2-api.xml	Fri Apr 11 13:58:43 2008
@@ -3046,6 +3046,7 @@
      <exports symbol='xmlSchemaValidityWarningFunc' type='function'/>
      <exports symbol='xmlSchemaDump' type='function'/>
      <exports symbol='xmlSchemaFreeValidCtxt' type='function'/>
+     <exports symbol='xmlSchemaValidCtxtGetParserCtxt' type='function'/>
      <exports symbol='xmlSchemaSetParserStructuredErrors' type='function'/>
      <exports symbol='xmlSchemaNewValidCtxt' type='function'/>
     </file>
@@ -8552,11 +8553,11 @@
     </function>
     <functype name='xmlC14NIsVisibleCallback' file='c14n' module='c14n'>
       <cond>defined(LIBXML_C14N_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='user_data' type='void *' info=''/>
-      <arg name='node' type='xmlNodePtr' info=''/>
-      <arg name='parent' type='xmlNodePtr' info=''/>
+      <info>Signature for a C14N callback on visible nodes</info>
+      <return type='int' info='1 if the node should be included'/>
+      <arg name='user_data' type='void *' info='user data'/>
+      <arg name='node' type='xmlNodePtr' info='the curent node'/>
+      <arg name='parent' type='xmlNodePtr' info='the parent node'/>
     </functype>
     <function name='xmlCanonicPath' file='uri' module='uri'>
       <info>Constructs a canonic path from the specified path.</info>
@@ -9247,9 +9248,9 @@
       <arg name='func' type='xmlDeregisterNodeFunc' info='function pointer to the new DeregisterNodeFunc'/>
     </function>
     <functype name='xmlDeregisterNodeFunc' file='globals' module='globals'>
-      <info></info>
+      <info>Signature for the deregistration callback of a discarded node</info>
       <return type='void'/>
-      <arg name='node' type='xmlNodePtr' info=''/>
+      <arg name='node' type='xmlNodePtr' info='the current node'/>
     </functype>
     <function name='xmlDetectCharEncoding' file='encoding' module='encoding'>
       <info>Guess the encoding of the entity using the first bytes of the entity content according to the non-normative appendix F of the XML-1.0 recommendation.</info>
@@ -11628,9 +11629,9 @@
       <arg name='func' type='xmlOutputBufferCreateFilenameFunc' info='function pointer to the new OutputBufferCreateFilenameFunc'/>
     </function>
     <functype name='xmlOutputBufferCreateFilenameFunc' file='globals' module='globals'>
-      <info></info>
-      <return type='xmlOutputBufferPtr' info=''/>
-      <arg name='URI' type='const char *' info=''/>
+      <info>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</info>
+      <return type='xmlOutputBufferPtr' info='the new xmlOutputBufferPtr in case of success or NULL if no method was found.'/>
+      <arg name='URI' type='const char *' info='the URI to write to'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info=''/>
       <arg name='compression' type='int' info=''/>
     </functype>
@@ -12143,10 +12144,10 @@
       <arg name='func' type='xmlParserInputBufferCreateFilenameFunc' info='function pointer to the new ParserInputBufferCreateFilenameFunc'/>
     </function>
     <functype name='xmlParserInputBufferCreateFilenameFunc' file='globals' module='globals'>
-      <info></info>
-      <return type='xmlParserInputBufferPtr' info=''/>
-      <arg name='URI' type='const char *' info=''/>
-      <arg name='enc' type='xmlCharEncoding' info=''/>
+      <info>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</info>
+      <return type='xmlParserInputBufferPtr' info='the new xmlParserInputBufferPtr in case of success or NULL if no method was found.'/>
+      <arg name='URI' type='const char *' info='the URI to read from'/>
+      <arg name='enc' type='xmlCharEncoding' info='the requested source encoding'/>
     </functype>
     <function name='xmlParserInputBufferCreateIO' file='xmlIO' module='xmlIO'>
       <info>Create a buffered parser input for the progressive parsing for the input from an I/O handler</info>
@@ -12525,12 +12526,12 @@
     </function>
     <functype name='xmlRegExecCallbacks' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
-      <info></info>
+      <info>Callback function when doing a transition in the automata</info>
       <return type='void'/>
-      <arg name='exec' type='xmlRegExecCtxtPtr' info=''/>
-      <arg name='token' type='const xmlChar *' info=''/>
-      <arg name='transdata' type='void *' info=''/>
-      <arg name='inputdata' type='void *' info=''/>
+      <arg name='exec' type='xmlRegExecCtxtPtr' info='the regular expression context'/>
+      <arg name='token' type='const xmlChar *' info='the current token string'/>
+      <arg name='transdata' type='void *' info='transition data'/>
+      <arg name='inputdata' type='void *' info='input data'/>
     </functype>
     <function name='xmlRegExecErrInfo' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
@@ -12649,9 +12650,9 @@
       <arg name='func' type='xmlRegisterNodeFunc' info='function pointer to the new RegisterNodeFunc'/>
     </function>
     <functype name='xmlRegisterNodeFunc' file='globals' module='globals'>
-      <info></info>
+      <info>Signature for the registration callback of a created node</info>
       <return type='void'/>
-      <arg name='node' type='xmlNodePtr' info=''/>
+      <arg name='node' type='xmlNodePtr' info='the current node'/>
     </functype>
     <function name='xmlRegisterOutputCallbacks' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
@@ -12828,19 +12829,19 @@
     </function>
     <functype name='xmlRelaxNGValidityErrorFunc' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Signature of an error callback from a Relax-NG validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <functype name='xmlRelaxNGValidityWarningFunc' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Signature of a warning callback from a Relax-NG validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <function name='xmlRelaxParserSetFlag' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13405,9 +13406,9 @@
     </function>
     <function name='xmlSchemaFreeValidCtxt' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Free the resources associated to the schema validation context</info>
       <return type='void'/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='the schema validation context'/>
     </function>
     <function name='xmlSchemaFreeValue' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13478,12 +13479,12 @@
     </function>
     <function name='xmlSchemaGetValidErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='err' type='xmlSchemaValidityErrorFunc *' info=''/>
-      <arg name='warn' type='xmlSchemaValidityWarningFunc *' info=''/>
-      <arg name='ctx' type='void **' info=''/>
+      <info>Get the error and warning callback informations</info>
+      <return type='int' info='-1 in case of error and 0 otherwise'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a XML-Schema validation context'/>
+      <arg name='err' type='xmlSchemaValidityErrorFunc *' info='the error function result'/>
+      <arg name='warn' type='xmlSchemaValidityWarningFunc *' info='the warning function result'/>
+      <arg name='ctx' type='void **' info='the functions context result'/>
     </function>
     <function name='xmlSchemaInitTypes' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13499,9 +13500,9 @@
     </function>
     <function name='xmlSchemaIsValid' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+      <info>Check if any error was detected during validation.</info>
+      <return type='int' info='1 if valid so far, 0 if errors were detected, and -1 in case of internal error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='the schema validation context'/>
     </function>
     <function name='xmlSchemaNewDocParserCtxt' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13550,9 +13551,9 @@
     </function>
     <function name='xmlSchemaNewValidCtxt' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='schema' type='xmlSchemaPtr' info=''/>
+      <info>Create an XML Schemas validation context based on the given schema.</info>
+      <return type='xmlSchemaValidCtxtPtr' info='the validation context or NULL in case of error'/>
+      <arg name='schema' type='xmlSchemaPtr' info='a precompiled XML Schemas'/>
     </function>
     <function name='xmlSchemaParse' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13562,17 +13563,17 @@
     </function>
     <function name='xmlSchemaSAXPlug' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='xmlSchemaSAXPlugPtr' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='sax' type='xmlSAXHandlerPtr *' info=''/>
-      <arg name='user_data' type='void **' info=''/>
+      <info>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</info>
+      <return type='xmlSchemaSAXPlugPtr' info='a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='sax' type='xmlSAXHandlerPtr *' info='a pointer to the original xmlSAXHandlerPtr'/>
+      <arg name='user_data' type='void **' info='a pointer to the original SAX user data pointer'/>
     </function>
     <function name='xmlSchemaSAXUnplug' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='plug' type='xmlSchemaSAXPlugPtr' info=''/>
+      <info>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</info>
+      <return type='int' info='0 in case of success and -1 in case of failure.'/>
+      <arg name='plug' type='xmlSchemaSAXPlugPtr' info='a data structure returned by xmlSchemaSAXPlug'/>
     </function>
     <function name='xmlSchemaSetParserErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13593,27 +13594,27 @@
     </function>
     <function name='xmlSchemaSetValidErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Set the error and warning callback informations</info>
       <return type='void'/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='err' type='xmlSchemaValidityErrorFunc' info=''/>
-      <arg name='warn' type='xmlSchemaValidityWarningFunc' info=''/>
-      <arg name='ctx' type='void *' info=''/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='err' type='xmlSchemaValidityErrorFunc' info='the error function'/>
+      <arg name='warn' type='xmlSchemaValidityWarningFunc' info='the warning function'/>
+      <arg name='ctx' type='void *' info='the functions context'/>
     </function>
     <function name='xmlSchemaSetValidOptions' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='options' type='int' info=''/>
+      <info>Sets the options to be used during the validation.</info>
+      <return type='int' info='0 in case of success, -1 in case of an API error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='options' type='int' info='a combination of xmlSchemaValidOption'/>
     </function>
     <function name='xmlSchemaSetValidStructuredErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Set the structured error callback</info>
       <return type='void'/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='serror' type='xmlStructuredErrorFunc' info=''/>
-      <arg name='ctx' type='void *' info=''/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='serror' type='xmlStructuredErrorFunc' info='the structured error function'/>
+      <arg name='ctx' type='void *' info='the functions context'/>
     </function>
     <function name='xmlSchemaValPredefTypeNode' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13635,16 +13636,22 @@
     </function>
     <function name='xmlSchemaValidCtxtGetOptions' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+      <info>Get the validation context options.</info>
+      <return type='int' info='the option combination or -1 on error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+    </function>
+    <function name='xmlSchemaValidCtxtGetParserCtxt' file='xmlschemas' module='xmlschemas'>
+      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <info>allow access to the parser context of the schema validation context</info>
+      <return type='xmlParserCtxtPtr' info='the parser context of the schema validation context or NULL in case of error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
     </function>
     <function name='xmlSchemaValidateDoc' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='instance' type='xmlDocPtr' info=''/>
+      <info>Validate a document tree in memory.</info>
+      <return type='int' info='0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='doc' type='xmlDocPtr' info='a parsed document tree'/>
     </function>
     <function name='xmlSchemaValidateFacet' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13668,11 +13675,11 @@
     </function>
     <function name='xmlSchemaValidateFile' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='filename' type='const char *' info=''/>
-      <arg name='options' type='int' info=''/>
+      <info>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</info>
+      <return type='int' info='0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='filename' type='const char *' info='the URI of the instance'/>
+      <arg name='options' type='int' info='a future set of options, currently unused'/>
     </function>
     <function name='xmlSchemaValidateLengthFacet' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13706,10 +13713,10 @@
     </function>
     <function name='xmlSchemaValidateOneElement' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='elem' type='xmlNodePtr' info=''/>
+      <info>Validate a branch of a tree, starting with the given @elem.</info>
+      <return type='int' info='0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='elem' type='xmlNodePtr' info='an element node'/>
     </function>
     <function name='xmlSchemaValidatePredefinedType' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13721,29 +13728,29 @@
     </function>
     <function name='xmlSchemaValidateStream' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
-      <arg name='input' type='xmlParserInputBufferPtr' info=''/>
-      <arg name='enc' type='xmlCharEncoding' info=''/>
-      <arg name='sax' type='xmlSAXHandlerPtr' info=''/>
-      <arg name='user_data' type='void *' info=''/>
+      <info>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</info>
+      <return type='int' info='0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.'/>
+      <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+      <arg name='input' type='xmlParserInputBufferPtr' info='the input to use for reading the data'/>
+      <arg name='enc' type='xmlCharEncoding' info='an optional encoding information'/>
+      <arg name='sax' type='xmlSAXHandlerPtr' info='a SAX handler for the resulting events'/>
+      <arg name='user_data' type='void *' info='the context to provide to the SAX handler.'/>
     </function>
     <functype name='xmlSchemaValidityErrorFunc' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Signature of an error callback from an XSD validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <functype name='xmlSchemaValidityWarningFunc' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info></info>
+      <info>Signature of a warning callback from an XSD validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <function name='xmlSchemaValueAppend' file='xmlschemastypes' module='xmlschemastypes'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13843,19 +13850,19 @@
     </function>
     <functype name='xmlSchematronValidityErrorFunc' file='schematron' module='schematron'>
       <cond>defined(LIBXML_SCHEMATRON_ENABLED)</cond>
-      <info></info>
+      <info>Signature of an error callback from a Schematron validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <functype name='xmlSchematronValidityWarningFunc' file='schematron' module='schematron'>
       <cond>defined(LIBXML_SCHEMATRON_ENABLED)</cond>
-      <info></info>
+      <info>Signature of a warning callback from a Schematron validation</info>
       <return type='void'/>
-      <arg name='ctx' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='...' type='...' info=''/>
+      <arg name='ctx' type='void *' info='the validation context'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <function name='xmlSearchNs' file='tree' module='tree'>
       <info>Search a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return NULL otherwise. @nameSpace can be NULL, this is a search for the default namespace. We don&apos;t allow to cross entities boundaries. If you don&apos;t declare the namespace within those you will be in troubles !!! A warning is generated to cover this case.</info>
@@ -14486,12 +14493,12 @@
     </function>
     <functype name='xmlTextReaderErrorFunc' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED)</cond>
-      <info></info>
+      <info>Signature of an error callback from a reader parser</info>
       <return type='void'/>
-      <arg name='arg' type='void *' info=''/>
-      <arg name='msg' type='const char *' info=''/>
-      <arg name='severity' type='xmlParserSeverities' info=''/>
-      <arg name='locator' type='xmlTextReaderLocatorPtr' info=''/>
+      <arg name='arg' type='void *' info='the user argument'/>
+      <arg name='msg' type='const char *' info='the message'/>
+      <arg name='severity' type='xmlParserSeverities' info='the severity of the error'/>
+      <arg name='locator' type='xmlTextReaderLocatorPtr' info='a locator indicating where the error occured'/>
     </functype>
     <function name='xmlTextReaderExpand' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED)</cond>

Modified: trunk/doc/libxml2-refs.xml
==============================================================================
--- trunk/doc/libxml2-refs.xml	(original)
+++ trunk/doc/libxml2-refs.xml	Fri Apr 11 13:58:43 2008
@@ -2741,6 +2741,7 @@
     <reference name='xmlSchemaValType' href='html/libxml-schemasInternals.html#xmlSchemaValType'/>
     <reference name='xmlSchemaValidCtxt' href='html/libxml-xmlschemas.html#xmlSchemaValidCtxt'/>
     <reference name='xmlSchemaValidCtxtGetOptions' href='html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions'/>
+    <reference name='xmlSchemaValidCtxtGetParserCtxt' href='html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt'/>
     <reference name='xmlSchemaValidCtxtPtr' href='html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr'/>
     <reference name='xmlSchemaValidError' href='html/libxml-xmlschemas.html#xmlSchemaValidError'/>
     <reference name='xmlSchemaValidOption' href='html/libxml-xmlschemas.html#xmlSchemaValidOption'/>
@@ -6294,6 +6295,7 @@
       <ref name='xmlSchemaValType'/>
       <ref name='xmlSchemaValidCtxt'/>
       <ref name='xmlSchemaValidCtxtGetOptions'/>
+      <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
       <ref name='xmlSchemaValidCtxtPtr'/>
       <ref name='xmlSchemaValidError'/>
       <ref name='xmlSchemaValidOption'/>
@@ -7612,6 +7614,7 @@
       <ref name='xmlCreatePushParserCtxt'/>
       <ref name='xmlCreateURLParserCtxt'/>
       <ref name='xmlNewParserCtxt'/>
+      <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
     </type>
     <type name='xmlParserErrors'>
       <ref name='xmlParseInNodeContext'/>
@@ -10070,6 +10073,7 @@
       <ref name='xmlSchemaSetValidOptions'/>
       <ref name='xmlSchemaSetValidStructuredErrors'/>
       <ref name='xmlSchemaValidCtxtGetOptions'/>
+      <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
       <ref name='xmlSchemaValidateDoc'/>
       <ref name='xmlSchemaValidateFile'/>
       <ref name='xmlSchemaValidateOneElement'/>
@@ -13419,6 +13423,7 @@
       <ref name='xmlSchemaSetValidStructuredErrors'/>
       <ref name='xmlSchemaValidCtxt'/>
       <ref name='xmlSchemaValidCtxtGetOptions'/>
+      <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
       <ref name='xmlSchemaValidCtxtPtr'/>
       <ref name='xmlSchemaValidError'/>
       <ref name='xmlSchemaValidOption'/>
@@ -14485,6 +14490,7 @@
         <word name='C14N'>
           <ref name='xmlC14NDocSaveTo'/>
           <ref name='xmlC14NExecute'/>
+          <ref name='xmlC14NIsVisibleCallback'/>
         </word>
         <word name='CATALOG'>
           <ref name='xmlLoadACatalog'/>
@@ -14594,6 +14600,7 @@
           <ref name='xmlOutputOpenCallback'/>
           <ref name='xmlOutputWriteCallback'/>
           <ref name='xmlParserInputDeallocate'/>
+          <ref name='xmlRegExecCallbacks'/>
           <ref name='xmlSAX2ExternalSubset'/>
           <ref name='xmlSAX2InternalSubset'/>
           <ref name='xmlValidityErrorFunc'/>
@@ -16751,6 +16758,9 @@
         <word name='Please'>
           <ref name='xmlNormalizeWindowsPath'/>
         </word>
+        <word name='Plug'>
+          <ref name='xmlSchemaSAXPlug'/>
+        </word>
         <word name='Pointer'>
           <ref name='xmlCheckUTF8'/>
         </word>
@@ -17125,6 +17135,8 @@
           <ref name='xmlRelaxNGSetValidErrors'/>
           <ref name='xmlRelaxNGSetValidStructuredErrors'/>
           <ref name='xmlRelaxNGValidateDoc'/>
+          <ref name='xmlRelaxNGValidityErrorFunc'/>
+          <ref name='xmlRelaxNGValidityWarningFunc'/>
         </word>
         <word name='RelaxNG'>
           <ref name='_xmlSchemaElement'/>
@@ -17257,6 +17269,7 @@
           <ref name='xmlSAX2InitDocbDefaultSAXHandler'/>
           <ref name='xmlSAX2InitHtmlDefaultSAXHandler'/>
           <ref name='xmlSAX2StartElementNs'/>
+          <ref name='xmlSchemaValidateStream'/>
         </word>
         <word name='SAX::substituteEntities'>
           <ref name='xmlSubstituteEntitiesDefault'/>
@@ -17354,12 +17367,15 @@
           <ref name='xmlSchemaNewDocParserCtxt'/>
           <ref name='xmlSchemaNewMemParserCtxt'/>
           <ref name='xmlSchemaNewParserCtxt'/>
+          <ref name='xmlSchemaNewValidCtxt'/>
         </word>
         <word name='Schematron'>
           <ref name='LIBXML_SCHEMATRON_ENABLED'/>
           <ref name='xmlSchematronFree'/>
           <ref name='xmlSchematronParse'/>
           <ref name='xmlSchematronSetValidStructuredErrors'/>
+          <ref name='xmlSchematronValidityErrorFunc'/>
+          <ref name='xmlSchematronValidityWarningFunc'/>
         </word>
         <word name='Schematrons'>
           <ref name='xmlSchematronNewDocParserCtxt'/>
@@ -17431,6 +17447,7 @@
         <word name='Sets'>
           <ref name='htmlSetMetaEncoding'/>
           <ref name='xmlBufferSetAllocationScheme'/>
+          <ref name='xmlSchemaSetValidOptions'/>
           <ref name='xmlXPathDifference'/>
           <ref name='xmlXPathDistinct'/>
           <ref name='xmlXPathDistinctSorted'/>
@@ -17480,12 +17497,24 @@
           <ref name='xmlShellPwd'/>
         </word>
         <word name='Signature'>
+          <ref name='xmlC14NIsVisibleCallback'/>
+          <ref name='xmlDeregisterNodeFunc'/>
           <ref name='xmlFreeFunc'/>
           <ref name='xmlGenericErrorFunc'/>
           <ref name='xmlMallocFunc'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlReallocFunc'/>
+          <ref name='xmlRegisterNodeFunc'/>
+          <ref name='xmlRelaxNGValidityErrorFunc'/>
+          <ref name='xmlRelaxNGValidityWarningFunc'/>
+          <ref name='xmlSchemaValidityErrorFunc'/>
+          <ref name='xmlSchemaValidityWarningFunc'/>
+          <ref name='xmlSchematronValidityErrorFunc'/>
+          <ref name='xmlSchematronValidityWarningFunc'/>
           <ref name='xmlStrdupFunc'/>
           <ref name='xmlStructuredErrorFunc'/>
+          <ref name='xmlTextReaderErrorFunc'/>
         </word>
         <word name='Similarly'>
           <ref name='xmlParseEntityRef'/>
@@ -17914,6 +17943,9 @@
         <word name='Unlinks'>
           <ref name='xmlDOMWrapRemoveNode'/>
         </word>
+        <word name='Unplug'>
+          <ref name='xmlSchemaSAXUnplug'/>
+        </word>
         <word name='Unregisters'>
           <ref name='xmlCleanupEncodingAliases'/>
           <ref name='xmlDelEncodingAlias'/>
@@ -17988,6 +18020,9 @@
           <ref name='XML_SCHEMAS_ANY_LAX'/>
           <ref name='xmlRelaxNGValidateDoc'/>
           <ref name='xmlRelaxNGValidateFullElement'/>
+          <ref name='xmlSchemaValidateDoc'/>
+          <ref name='xmlSchemaValidateOneElement'/>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlSchematronValidateDoc'/>
           <ref name='xmlShellValidate'/>
           <ref name='xmlValidateAttributeValue'/>
@@ -18174,6 +18209,9 @@
           <ref name='xmlValidateOneNamespace'/>
           <ref name='xmlValidateRoot'/>
         </word>
+        <word name='XML-Schema'>
+          <ref name='xmlSchemaGetValidErrors'/>
+        </word>
         <word name='XMLDecl'>
           <ref name='xmlParseXMLDecl'/>
         </word>
@@ -18297,6 +18335,8 @@
         </word>
         <word name='XSD'>
           <ref name='xmlAutomataNewNegTrans'/>
+          <ref name='xmlSchemaValidityErrorFunc'/>
+          <ref name='xmlSchemaValidityWarningFunc'/>
           <ref name='xmlTextReaderSchemaValidate'/>
           <ref name='xmlTextReaderSchemaValidateCtxt'/>
           <ref name='xmlTextReaderSetSchema'/>
@@ -18452,6 +18492,7 @@
           <ref name='xmlMemSetup'/>
           <ref name='xmlNewMutex'/>
           <ref name='xmlNewRMutex'/>
+          <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
         </word>
         <word name='accessed'>
           <ref name='xmlTextReaderCurrentDoc'/>
@@ -18769,6 +18810,7 @@
           <ref name='xmlKeepBlanksDefault'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlSchemaValidCtxtGetParserCtxt'/>
           <ref name='xmlSearchNs'/>
           <ref name='xmlShell'/>
           <ref name='xmlValidateNCName'/>
@@ -19243,6 +19285,10 @@
           <ref name='xmlNewStringInputStream'/>
           <ref name='xmlRelaxNGNewValidCtxt'/>
           <ref name='xmlSchemaNewStringValue'/>
+          <ref name='xmlSchemaNewValidCtxt'/>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlSchematronNewValidCtxt'/>
           <ref name='xmlSetCompressMode'/>
           <ref name='xmlSetDocCompressMode'/>
@@ -19439,6 +19485,7 @@
         <word name='branch'>
           <ref name='xmlDOMWrapCloneNode'/>
           <ref name='xmlDOMWrapRemoveNode'/>
+          <ref name='xmlSchemaValidateOneElement'/>
         </word>
         <word name='break'>
           <ref name='_xmlError'/>
@@ -19584,6 +19631,7 @@
         </word>
         <word name='calls'>
           <ref name='xlinkNodeDetectFunc'/>
+          <ref name='xmlSchemaSAXPlug'/>
           <ref name='xmlXPathAxisFunc'/>
         </word>
         <word name='came'>
@@ -20638,6 +20686,8 @@
           <ref name='xmlGetDocEntity'/>
           <ref name='xmlGetDtdEntity'/>
           <ref name='xmlGetParameterEntity'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlSetProp'/>
           <ref name='xmlXPathTranslateFunction'/>
         </word>
@@ -20757,6 +20807,9 @@
         <word name='cur'>
           <ref name='xmlXPathAxisFunc'/>
         </word>
+        <word name='curent'>
+          <ref name='xmlC14NIsVisibleCallback'/>
+        </word>
         <word name='currently'>
           <ref name='XML_SCHEMAS_INCLUDING_CONVERT_NS'/>
           <ref name='xmlGcMemGet'/>
@@ -20764,6 +20817,7 @@
           <ref name='xmlMemGet'/>
           <ref name='xmlMemUsed'/>
           <ref name='xmlOutputBufferCreateFilename'/>
+          <ref name='xmlSchemaValidateFile'/>
           <ref name='xmlXPathContextSetCache'/>
         </word>
         <word name='custom'>
@@ -21062,6 +21116,7 @@
         </word>
         <word name='deregistration'>
           <ref name='xmlDeregisterNodeDefault'/>
+          <ref name='xmlDeregisterNodeFunc'/>
         </word>
         <word name='derivation'>
           <ref name='XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION'/>
@@ -21210,6 +21265,7 @@
           <ref name='xmlSAX2EndElementNs'/>
           <ref name='xmlSAX2Reference'/>
           <ref name='xmlSAX2StartElementNs'/>
+          <ref name='xmlSchemaIsValid'/>
         </word>
         <word name='detection'>
           <ref name='docbCreatePushParserCtxt'/>
@@ -21369,6 +21425,9 @@
         <word name='discard'>
           <ref name='xmlParserInputRead'/>
         </word>
+        <word name='discarded'>
+          <ref name='xmlDeregisterNodeFunc'/>
+        </word>
         <word name='discarding'>
           <ref name='xmlParseAttValue'/>
           <ref name='xmlValidCtxtNormalizeAttributeValue'/>
@@ -21461,6 +21520,11 @@
           <ref name='xmlXPathTrailing'/>
           <ref name='xmlXPathTrailingSorted'/>
         </word>
+        <word name='doing'>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
+          <ref name='xmlRegExecCallbacks'/>
+        </word>
         <word name='don'>
           <ref name='XML_SCHEMAS_ANY_LAX'/>
           <ref name='xlinkIsLink'/>
@@ -21567,7 +21631,9 @@
         </word>
         <word name='during'>
           <ref name='xmlSAXDefaultVersion'/>
+          <ref name='xmlSchemaIsValid'/>
           <ref name='xmlSchemaNewDocParserCtxt'/>
+          <ref name='xmlSchemaSetValidOptions'/>
           <ref name='xmlSchematronNewDocParserCtxt'/>
         </word>
         <word name='dynamic'>
@@ -22005,8 +22071,14 @@
           <ref name='xmlTextWriterFullEndElement'/>
           <ref name='xmlXPathRoundFunction'/>
         </word>
+        <word name='event'>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
+          <ref name='xmlSchemaValidateStream'/>
+        </word>
         <word name='events'>
           <ref name='htmlSAXParseDoc'/>
+          <ref name='xmlSchemaValidateStream'/>
         </word>
         <word name='ever'>
           <ref name='xmlExpCtxtNbCons'/>
@@ -22274,6 +22346,7 @@
         <word name='far'>
           <ref name='_xmlParserCtxt'/>
           <ref name='fatalErrorSAXFunc'/>
+          <ref name='xmlSchemaIsValid'/>
         </word>
         <word name='fashion'>
           <ref name='xmlNewRMutex'/>
@@ -22478,6 +22551,9 @@
         </word>
         <word name='flow'>
           <ref name='xmlScanName'/>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
+          <ref name='xmlSchemaValidateStream'/>
         </word>
         <word name='flushed'>
           <ref name='xmlTextWriterEndDocument'/>
@@ -22596,6 +22672,9 @@
           <ref name='xmlParseCtxtExternalEntity'/>
           <ref name='xmlParseExternalEntity'/>
         </word>
+        <word name='forward'>
+          <ref name='xmlSchemaValidateStream'/>
+        </word>
         <word name='fptr'>
           <ref name='XML_CAST_FPTR'/>
         </word>
@@ -22707,8 +22786,11 @@
           <ref name='xmlRelaxNGSetParserStructuredErrors'/>
           <ref name='xmlRelaxNGSetValidErrors'/>
           <ref name='xmlRelaxNGSetValidStructuredErrors'/>
+          <ref name='xmlSchemaGetValidErrors'/>
           <ref name='xmlSchemaSetParserErrors'/>
           <ref name='xmlSchemaSetParserStructuredErrors'/>
+          <ref name='xmlSchemaSetValidErrors'/>
+          <ref name='xmlSchemaSetValidStructuredErrors'/>
           <ref name='xmlSchematronSetValidStructuredErrors'/>
           <ref name='xmlShellCmd'/>
           <ref name='xmlSwitchEncoding'/>
@@ -22726,6 +22808,7 @@
         </word>
         <word name='future'>
           <ref name='_xmlDOMWrapCtxt'/>
+          <ref name='xmlSchemaValidateFile'/>
         </word>
       </letter>
     </chunk>
@@ -23335,6 +23418,7 @@
           <ref name='xmlC14NDocDumpMemory'/>
           <ref name='xmlC14NDocSave'/>
           <ref name='xmlC14NDocSaveTo'/>
+          <ref name='xmlC14NIsVisibleCallback'/>
           <ref name='xmlDocDumpMemory'/>
           <ref name='xmlFreeDoc'/>
           <ref name='xmlNanoHTTPContentLength'/>
@@ -23461,6 +23545,7 @@
           <ref name='xmlParseCharData'/>
           <ref name='xmlParserFindNodeInfoIndex'/>
           <ref name='xmlShellCmd'/>
+          <ref name='xmlTextReaderErrorFunc'/>
           <ref name='xmlTextReaderNormalization'/>
           <ref name='xmlXPathAxisFunc'/>
         </word>
@@ -23536,6 +23621,7 @@
           <ref name='xmlNewTextReader'/>
           <ref name='xmlRelaxNGGetParserErrors'/>
           <ref name='xmlSchemaGetParserErrors'/>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlTextReaderByteConsumed'/>
           <ref name='xmlXPathOrderDocElems'/>
         </word>
@@ -23562,6 +23648,8 @@
           <ref name='xmlRelaxParserSetFlag'/>
           <ref name='xmlSAX2EndElementNs'/>
           <ref name='xmlSAX2StartElementNs'/>
+          <ref name='xmlSchemaGetValidErrors'/>
+          <ref name='xmlSchemaSetValidErrors'/>
           <ref name='xmlShellDir'/>
           <ref name='xmlXIncludeProcessNode'/>
         </word>
@@ -23789,6 +23877,7 @@
           <ref name='xmlRelaxNGNewDocParserCtxt'/>
           <ref name='xmlRemoveID'/>
           <ref name='xmlRemoveRef'/>
+          <ref name='xmlSchemaValidateFile'/>
           <ref name='xmlXPathContextSetCache'/>
         </word>
         <word name='interned'>
@@ -24018,6 +24107,8 @@
           <ref name='xmlRootNode'/>
           <ref name='xmlSaveFileTo'/>
           <ref name='xmlSaveFormatFileTo'/>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
         </word>
         <word name='leading'>
           <ref name='xmlParseAttValue'/>
@@ -24314,6 +24405,7 @@
           <ref name='xmlCanonicPath'/>
           <ref name='xmlPathToURI'/>
           <ref name='xmlSAX2SetDocumentLocator'/>
+          <ref name='xmlTextReaderErrorFunc'/>
           <ref name='xmlTextReaderLocatorBaseURI'/>
           <ref name='xmlTextReaderLocatorLineNumber'/>
         </word>
@@ -24419,6 +24511,7 @@
         <word name='maintained'>
           <ref name='xmlRemoveID'/>
           <ref name='xmlRemoveRef'/>
+          <ref name='xmlSchemaSAXPlug'/>
         </word>
         <word name='major'>
           <ref name='xmlDecodeEntities'/>
@@ -24643,22 +24736,6 @@
           <ref name='xmlAddPrevSibling'/>
           <ref name='xmlAddSibling'/>
         </word>
-        <word name='message'>
-          <ref name='_xmlError'/>
-          <ref name='errorSAXFunc'/>
-          <ref name='fatalErrorSAXFunc'/>
-          <ref name='warningSAXFunc'/>
-          <ref name='xmlGenericErrorFunc'/>
-          <ref name='xmlParserError'/>
-          <ref name='xmlParserValidityError'/>
-          <ref name='xmlParserValidityWarning'/>
-          <ref name='xmlParserWarning'/>
-          <ref name='xmlStrPrintf'/>
-          <ref name='xmlStrVPrintf'/>
-          <ref name='xmlValidityErrorFunc'/>
-          <ref name='xmlValidityWarningFunc'/>
-          <ref name='xmlXPatherror'/>
-        </word>
         <word name='messages'>
           <ref name='errorSAXFunc'/>
           <ref name='fatalErrorSAXFunc'/>
@@ -24676,6 +24753,8 @@
           <ref name='_xmlBuffer'/>
           <ref name='xmlNanoHTTPMethod'/>
           <ref name='xmlNanoHTTPMethodRedir'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlRegisterHTTPPostCallbacks'/>
           <ref name='xmlSetBufferAllocationScheme'/>
           <ref name='xmlTextReaderClose'/>
@@ -24992,6 +25071,7 @@
           <ref name='xmlParseElementChildrenContentDecl'/>
           <ref name='xmlParseElementMixedContentDecl'/>
           <ref name='xmlReconciliateNs'/>
+          <ref name='xmlSchemaSAXPlug'/>
           <ref name='xmlSetBufferAllocationScheme'/>
           <ref name='xmlShellPwd'/>
           <ref name='xmlStrncat'/>
@@ -25348,6 +25428,7 @@
           <ref name='xmlHashCreateDict'/>
           <ref name='xmlListRemoveFirst'/>
           <ref name='xmlListRemoveLast'/>
+          <ref name='xmlTextReaderErrorFunc'/>
         </word>
         <word name='occurences'>
           <ref name='xmlAutomataNewCountTrans'/>
@@ -25572,6 +25653,7 @@
           <ref name='xmlDOMWrapCloneNode'/>
           <ref name='xmlDOMWrapReconcileNamespaces'/>
           <ref name='xmlGetLineNo'/>
+          <ref name='xmlSchemaValidCtxtGetOptions'/>
         </word>
         <word name='options'>
           <ref name='htmlCtxtUseOptions'/>
@@ -25582,6 +25664,9 @@
           <ref name='xmlSaveToFd'/>
           <ref name='xmlSaveToFilename'/>
           <ref name='xmlSaveToIO'/>
+          <ref name='xmlSchemaSetValidOptions'/>
+          <ref name='xmlSchemaValidCtxtGetOptions'/>
+          <ref name='xmlSchemaValidateFile'/>
           <ref name='xmlTextReaderSchemaValidateCtxt'/>
           <ref name='xmlTextReaderSetup'/>
           <ref name='xmlXPathContextSetCache'/>
@@ -25625,6 +25710,8 @@
           <ref name='xmlListMerge'/>
           <ref name='xmlParseEntityValue'/>
           <ref name='xmlParseURIRaw'/>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
           <ref name='xmlShellSave'/>
           <ref name='xmlStrcat'/>
           <ref name='xmlStrncat'/>
@@ -25962,6 +26049,8 @@
           <ref name='xmlReconciliateNs'/>
           <ref name='xmlRegExecErrInfo'/>
           <ref name='xmlRegExecNextValues'/>
+          <ref name='xmlSchemaSAXPlug'/>
+          <ref name='xmlSchemaSAXUnplug'/>
           <ref name='xmlValidGetValidElements'/>
         </word>
         <word name='points'>
@@ -26003,37 +26092,6 @@
         <word name='positions'>
           <ref name='xmlUTF8Strsub'/>
         </word>
-        <word name='positive'>
-          <ref name='UTF8ToHtml'/>
-          <ref name='UTF8Toisolat1'/>
-          <ref name='docbEncodeEntities'/>
-          <ref name='htmlEncodeEntities'/>
-          <ref name='isolat1ToUTF8'/>
-          <ref name='xmlBufferAdd'/>
-          <ref name='xmlBufferAddHead'/>
-          <ref name='xmlBufferCCat'/>
-          <ref name='xmlBufferCat'/>
-          <ref name='xmlCharEncodingInputFunc'/>
-          <ref name='xmlCharEncodingOutputFunc'/>
-          <ref name='xmlRelaxNGValidateDoc'/>
-          <ref name='xmlSchemaCheckFacet'/>
-          <ref name='xmlSchemaValPredefTypeNode'/>
-          <ref name='xmlSchemaValPredefTypeNodeNoNorm'/>
-          <ref name='xmlSchemaValidateFacet'/>
-          <ref name='xmlSchemaValidateFacetWhtsp'/>
-          <ref name='xmlSchemaValidateLengthFacet'/>
-          <ref name='xmlSchemaValidateLengthFacetWhtsp'/>
-          <ref name='xmlSchemaValidateListSimpleTypeFacet'/>
-          <ref name='xmlSchemaValidatePredefinedType'/>
-          <ref name='xmlTextReaderPreservePattern'/>
-          <ref name='xmlValidateNCName'/>
-          <ref name='xmlValidateNMToken'/>
-          <ref name='xmlValidateName'/>
-          <ref name='xmlValidateQName'/>
-          <ref name='xmlXPathBooleanFunction'/>
-          <ref name='xmlXPathFloorFunction'/>
-          <ref name='xmlXPathStringFunction'/>
-        </word>
         <word name='possible'>
           <ref name='xmlCopyNodeList'/>
           <ref name='xmlCreateEntityParserCtxt'/>
@@ -26111,6 +26169,7 @@
           <ref name='xmlPatternStreamable'/>
           <ref name='xmlRegNewExecCtxt'/>
           <ref name='xmlRelaxNGNewValidCtxt'/>
+          <ref name='xmlSchemaNewValidCtxt'/>
           <ref name='xmlSchematronNewValidCtxt'/>
           <ref name='xmlTextReaderRelaxNGSetSchema'/>
           <ref name='xmlTextReaderSetSchema'/>
@@ -26455,6 +26514,7 @@
           <ref name='xmlOutputMatchCallback'/>
           <ref name='xmlSaveFormatFile'/>
           <ref name='xmlSaveFormatFileEnc'/>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlUTF8Strloc'/>
           <ref name='xmlUTF8Strpos'/>
         </word>
@@ -26663,6 +26723,7 @@
           <ref name='xmlTextReaderGetRemainder'/>
         </word>
         <word name='reading'>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlShell'/>
         </word>
         <word name='ready'>
@@ -26936,9 +26997,11 @@
           <ref name='xmlOutputBufferCreateFilenameDefault'/>
           <ref name='xmlParserInputBufferCreateFilenameDefault'/>
           <ref name='xmlRegisterNodeDefault'/>
+          <ref name='xmlRegisterNodeFunc'/>
         </word>
         <word name='regular'>
           <ref name='LIBXML_REGEXP_ENABLED'/>
+          <ref name='xmlRegExecCallbacks'/>
           <ref name='xmlRegFreeExecCtxt'/>
           <ref name='xmlRegNewExecCtxt'/>
           <ref name='xmlRegexpCompile'/>
@@ -27087,6 +27150,7 @@
           <ref name='xmlHashUpdateEntry2'/>
           <ref name='xmlHashUpdateEntry3'/>
           <ref name='xmlNewTextChild'/>
+          <ref name='xmlSchemaSAXPlug'/>
           <ref name='xmlXPathTranslateFunction'/>
         </word>
         <word name='replacement'>
@@ -27160,6 +27224,7 @@
           <ref name='xmlHasFeature'/>
           <ref name='xmlIsID'/>
           <ref name='xmlMallocFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlReallocFunc'/>
         </word>
         <word name='requests'>
@@ -27247,6 +27312,7 @@
           <ref name='xmlRelaxNGFreeParserCtxt'/>
           <ref name='xmlRelaxNGFreeValidCtxt'/>
           <ref name='xmlSchemaFreeParserCtxt'/>
+          <ref name='xmlSchemaFreeValidCtxt'/>
           <ref name='xmlSchematronFreeParserCtxt'/>
           <ref name='xmlSchematronFreeValidCtxt'/>
           <ref name='xmlTextReaderClose'/>
@@ -27273,6 +27339,7 @@
           <ref name='xmlPathToURI'/>
         </word>
         <word name='restored'>
+          <ref name='xmlSchemaSAXUnplug'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
           <ref name='xmlTextReaderSetStructuredErrorHandler'/>
         </word>
@@ -27560,8 +27627,11 @@
           <ref name='xmlSchemaGetFacetValueAsULong'/>
           <ref name='xmlSchemaGetValType'/>
           <ref name='xmlSchemaNewMemParserCtxt'/>
+          <ref name='xmlSchemaValidateDoc'/>
           <ref name='xmlSchemaValidateFacet'/>
           <ref name='xmlSchemaValidateFacetWhtsp'/>
+          <ref name='xmlSchemaValidateFile'/>
+          <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlSchematronNewMemParserCtxt'/>
           <ref name='xmlTextReaderSchemaValidate'/>
           <ref name='xmlTextReaderSchemaValidateCtxt'/>
@@ -27769,6 +27839,9 @@
         <word name='setups'>
           <ref name='xmlParseEncodingDecl'/>
         </word>
+        <word name='severity'>
+          <ref name='xmlTextReaderErrorFunc'/>
+        </word>
         <word name='sgmlsource'>
           <ref name='getSystemId'/>
           <ref name='xmlSAX2GetSystemId'/>
@@ -28030,6 +28103,7 @@
           <ref name='xmlCopyError'/>
           <ref name='xmlCtxtReadIO'/>
           <ref name='xmlNewTextReader'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlReadIO'/>
           <ref name='xmlReaderForIO'/>
           <ref name='xmlReaderNewIO'/>
@@ -28220,6 +28294,7 @@
           <ref name='xmlNewCharRef'/>
           <ref name='xmlNewTextWriterTree'/>
           <ref name='xmlSaveTree'/>
+          <ref name='xmlSchemaValidateOneElement'/>
           <ref name='xmlXPathOrderDocElems'/>
           <ref name='xmlXPathSubstringFunction'/>
           <ref name='xmlXPtrNewCollapsedRange'/>
@@ -28364,6 +28439,7 @@
         </word>
         <word name='streamable'>
           <ref name='xmlPatternStreamable'/>
+          <ref name='xmlSchemaValidateFile'/>
         </word>
         <word name='streaming'>
           <ref name='xmlPatternGetStreamCtxt'/>
@@ -28443,6 +28519,7 @@
         <word name='structured'>
           <ref name='xmlRelaxNGSetValidStructuredErrors'/>
           <ref name='xmlSchemaSetParserStructuredErrors'/>
+          <ref name='xmlSchemaSetValidStructuredErrors'/>
           <ref name='xmlSchematronSetValidStructuredErrors'/>
           <ref name='xmlSetStructuredErrorFunc'/>
         </word>
@@ -28571,6 +28648,7 @@
           <ref name='xmlReconciliateNs'/>
           <ref name='xmlRelaxNGValidateFullElement'/>
           <ref name='xmlSaveTree'/>
+          <ref name='xmlSchemaValidateOneElement'/>
           <ref name='xmlShellDu'/>
           <ref name='xmlShellWrite'/>
           <ref name='xmlTextReaderExpand'/>
@@ -28661,6 +28739,8 @@
         </word>
         <word name='suitable'>
           <ref name='xmlNewIOInputStream'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlRegexpCompile'/>
         </word>
         <word name='sum'>
@@ -28990,6 +29070,7 @@
           <ref name='xmlMutexLock'/>
           <ref name='xmlMutexUnlock'/>
           <ref name='xmlNewMutex'/>
+          <ref name='xmlRegExecCallbacks'/>
           <ref name='xmlRegExecPushString'/>
           <ref name='xmlRegExecPushString2'/>
         </word>
@@ -29419,6 +29500,9 @@
           <ref name='xmlParserHandleReference'/>
           <ref name='xmlSAX2UnparsedEntityDecl'/>
         </word>
+        <word name='unplug'>
+          <ref name='xmlSchemaSAXPlug'/>
+        </word>
         <word name='unpredictable'>
           <ref name='UTF8ToHtml'/>
           <ref name='UTF8Toisolat1'/>
@@ -29468,6 +29552,7 @@
           <ref name='_xmlXPathContext'/>
           <ref name='xmlDOMWrapReconcileNamespaces'/>
           <ref name='xmlDOMWrapRemoveNode'/>
+          <ref name='xmlSchemaValidateFile'/>
           <ref name='xmlShellBase'/>
           <ref name='xmlShellCat'/>
           <ref name='xmlShellDir'/>
@@ -29658,6 +29743,7 @@
         </word>
         <word name='visible'>
           <ref name='xmlC14NExecute'/>
+          <ref name='xmlC14NIsVisibleCallback'/>
         </word>
         <word name='void'>
           <ref name='XML_CAST_FPTR'/>
@@ -29702,9 +29788,14 @@
           <ref name='xmlRelaxNGGetValidErrors'/>
           <ref name='xmlRelaxNGSetParserErrors'/>
           <ref name='xmlRelaxNGSetValidErrors'/>
+          <ref name='xmlRelaxNGValidityWarningFunc'/>
           <ref name='xmlSAX2InitDefaultSAXHandler'/>
           <ref name='xmlSchemaGetParserErrors'/>
+          <ref name='xmlSchemaGetValidErrors'/>
           <ref name='xmlSchemaSetParserErrors'/>
+          <ref name='xmlSchemaSetValidErrors'/>
+          <ref name='xmlSchemaValidityWarningFunc'/>
+          <ref name='xmlSchematronValidityWarningFunc'/>
           <ref name='xmlSearchNs'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
           <ref name='xmlTextReaderSetStructuredErrorHandler'/>
@@ -29773,6 +29864,7 @@
           <ref name='xmlCheckLanguageID'/>
           <ref name='xmlKeepBlanksDefault'/>
           <ref name='xmlMemShow'/>
+          <ref name='xmlSchemaIsValid'/>
           <ref name='xmlXIncludeProcess'/>
           <ref name='xmlXIncludeProcessFlags'/>
           <ref name='xmlXIncludeProcessFlagsData'/>
@@ -29807,6 +29899,7 @@
           <ref name='xmlNewNs'/>
           <ref name='xmlParseMarkupDecl'/>
           <ref name='xmlParseSDDecl'/>
+          <ref name='xmlTextReaderErrorFunc'/>
         </word>
         <word name='while'>
           <ref name='xmlInitCharEncodingHandlers'/>
@@ -29984,6 +30077,7 @@
           <ref name='xmlIOFTPRead'/>
           <ref name='xmlIOHTTPRead'/>
           <ref name='xmlNewCharEncodingHandler'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
           <ref name='xmlOutputBufferCreateIO'/>
           <ref name='xmlOutputWriteCallback'/>
           <ref name='xmlSaveToIO'/>
@@ -30593,6 +30687,7 @@
         </word>
         <word name='xmlOutputBufferPtr'>
           <ref name='xmlNewTextWriter'/>
+          <ref name='xmlOutputBufferCreateFilenameFunc'/>
         </word>
         <word name='xmlOutputCloseCallback'>
           <ref name='xmlRegisterOutputCallbacks'/>
@@ -30655,6 +30750,7 @@
         </word>
         <word name='xmlParserInputBufferPtr'>
           <ref name='xmlNewTextReader'/>
+          <ref name='xmlParserInputBufferCreateFilenameFunc'/>
           <ref name='xmlTextReaderGetRemainder'/>
           <ref name='xmlTextReaderSetup'/>
         </word>
@@ -30817,6 +30913,9 @@
         <word name='xmlSAX2UnparsedEntityDecl'>
           <ref name='unparsedEntityDecl'/>
         </word>
+        <word name='xmlSAXHandlerPtr'>
+          <ref name='xmlSchemaSAXPlug'/>
+        </word>
         <word name='xmlSAXVersion'>
           <ref name='xmlSAXDefaultVersion'/>
         </word>
@@ -30826,9 +30925,15 @@
           <ref name='xmlSaveToFilename'/>
           <ref name='xmlSaveToIO'/>
         </word>
+        <word name='xmlSchemaSAXPlug'>
+          <ref name='xmlSchemaSAXUnplug'/>
+        </word>
         <word name='xmlSchemaValType'>
           <ref name='xmlSchemaGetValType'/>
         </word>
+        <word name='xmlSchemaValidOption'>
+          <ref name='xmlSchemaSetValidOptions'/>
+        </word>
         <word name='xmlSchematronValidOptions'>
           <ref name='xmlSchematronNewValidCtxt'/>
         </word>

Modified: trunk/elfgcchack.h
==============================================================================
--- trunk/elfgcchack.h	(original)
+++ trunk/elfgcchack.h	Fri Apr 11 13:58:43 2008
@@ -9843,6 +9843,18 @@
 
 #if defined(LIBXML_SCHEMAS_ENABLED)
 #ifdef bottom_xmlschemas
+#undef xmlSchemaValidCtxtGetParserCtxt
+extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt __attribute((alias("xmlSchemaValidCtxtGetParserCtxt__internal_alias")));
+#else
+#ifndef xmlSchemaValidCtxtGetParserCtxt
+extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt__internal_alias __attribute((visibility("hidden")));
+#define xmlSchemaValidCtxtGetParserCtxt xmlSchemaValidCtxtGetParserCtxt__internal_alias
+#endif
+#endif
+#endif
+
+#if defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef bottom_xmlschemas
 #undef xmlSchemaValidateDoc
 extern __typeof (xmlSchemaValidateDoc) xmlSchemaValidateDoc __attribute((alias("xmlSchemaValidateDoc__internal_alias")));
 #else

Modified: trunk/include/libxml/c14n.h
==============================================================================
--- trunk/include/libxml/c14n.h	(original)
+++ trunk/include/libxml/c14n.h	Fri Apr 11 13:58:43 2008
@@ -2,30 +2,30 @@
  * Summary: Provide Canonical XML and Exclusive XML Canonicalization
  * Description: the c14n modules provides a
  *
- * "Canonical XML" implementation 
+ * "Canonical XML" implementation
  * http://www.w3.org/TR/xml-c14n
- * 
+ *
  * and an
  *
  * "Exclusive XML Canonicalization" implementation
  * http://www.w3.org/TR/xml-exc-c14n
- 
+
  * Copy: See Copyright for the status of this software.
- * 
+ *
  * Author: Aleksey Sanin <aleksey aleksey com>
  */
 #ifndef __XML_C14N_H__
-#define __XML_C14N_H__    
+#define __XML_C14N_H__
 #ifdef LIBXML_C14N_ENABLED
 #ifdef LIBXML_OUTPUT_ENABLED
 
 #ifdef __cplusplus
 extern "C" {
-#endif /* __cplusplus */ 
+#endif /* __cplusplus */
 
 #include <libxml/xmlversion.h>
 #include <libxml/tree.h>
-#include <libxml/xpath.h> 
+#include <libxml/xpath.h>
 
 /*
  * XML Canonicazation
@@ -37,28 +37,28 @@
  * Canonical form of an XML document could be created if and only if
  *  a) default attributes (if any) are added to all nodes
  *  b) all character and parsed entity references are resolved
- * In order to achive this in libxml2 the document MUST be loaded with 
+ * In order to achive this in libxml2 the document MUST be loaded with
  * following global setings:
- *    
+ *
  *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
  *    xmlSubstituteEntitiesDefault(1);
  *
  * or corresponding parser context setting:
  *    xmlParserCtxtPtr ctxt;
- *    
- *    ... 
+ *
+ *    ...
  *    ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
  *    ctxt->replaceEntities = 1;
  *    ...
  */
 
 
-XMLPUBFUN int XMLCALL 		
+XMLPUBFUN int XMLCALL
 		xmlC14NDocSaveTo	(xmlDocPtr doc,
 					 xmlNodeSetPtr nodes,
 					 int exclusive,
 					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments, 
+					 int with_comments,
 					 xmlOutputBufferPtr buf);
 
 XMLPUBFUN int XMLCALL
@@ -66,7 +66,7 @@
 					 xmlNodeSetPtr nodes,
 					 int exclusive,
 					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments, 
+					 int with_comments,
 					 xmlChar **doc_txt_ptr);
 
 XMLPUBFUN int XMLCALL
@@ -74,7 +74,7 @@
 					 xmlNodeSetPtr nodes,
 					 int exclusive,
 					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments, 
+					 int with_comments,
 					 const char* filename,
 					 int compression);
 
@@ -82,17 +82,27 @@
 /**
  * This is the core C14N function
  */
-typedef int (*xmlC14NIsVisibleCallback)	(void* user_data, 
+/**
+ * xmlC14NIsVisibleCallback:
+ * @user_data: user data
+ * @node: the curent node
+ * @parent: the parent node
+ *
+ * Signature for a C14N callback on visible nodes
+ *
+ * Returns 1 if the node should be included
+ */
+typedef int (*xmlC14NIsVisibleCallback)	(void* user_data,
 					 xmlNodePtr node,
 					 xmlNodePtr parent);
 
 XMLPUBFUN int XMLCALL
 		xmlC14NExecute		(xmlDocPtr doc,
 					 xmlC14NIsVisibleCallback is_visible_callback,
-					 void* user_data,				 
+					 void* user_data,
 					 int exclusive,
 					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments, 
+					 int with_comments,
 					 xmlOutputBufferPtr buf);
 
 #ifdef __cplusplus

Modified: trunk/include/libxml/globals.h
==============================================================================
--- trunk/include/libxml/globals.h	(original)
+++ trunk/include/libxml/globals.h	Fri Apr 11 13:58:43 2008
@@ -28,8 +28,32 @@
 XMLPUBFUN void XMLCALL xmlInitGlobals(void);
 XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
 
+/**
+ * xmlParserInputBufferCreateFilenameFunc:
+ * @URI: the URI to read from
+ * @enc: the requested source encoding
+ *
+ * Signature for the function doing the lookup for a suitable input method
+ * corresponding to an URI.
+ *
+ * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
+ *         method was found.
+ */
 typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
+
+/**
+ * xmlOutputBufferCreateFilenameFunc:
+ * @URI: the URI to write to
+ * @enc: the requested target encoding
+ *
+ * Signature for the function doing the lookup for a suitable output method
+ * corresponding to an URI.
+ *
+ * Returns the new xmlOutputBufferPtr in case of success or NULL if no
+ *         method was found.
+ */
 typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
+
 XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
 XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
 XMLPUBFUN xmlOutputBufferCreateFilenameFunc
@@ -73,12 +97,24 @@
 #undef  xmlParserInputBufferCreateFilenameValue
 #undef  xmlOutputBufferCreateFilenameValue
 
+/**
+ * xmlRegisterNodeFunc:
+ * @node: the current node
+ *
+ * Signature for the registration callback of a created node
+ */
 typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
+/**
+ * xmlDeregisterNodeFunc:
+ * @node: the current node
+ *
+ * Signature for the deregistration callback of a discarded node
+ */
 typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
 
 typedef struct _xmlGlobalState xmlGlobalState;
 typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState 
+struct _xmlGlobalState
 {
 	const char *xmlParserVersion;
 
@@ -114,8 +150,8 @@
 	int xmlIndentTreeOutput;
 	const char *xmlTreeIndentString;
 
-  	xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
-  	xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+	xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+	xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
 
 	xmlMallocFunc xmlMallocAtomic;
 	xmlError xmlLastError;
@@ -143,9 +179,9 @@
 XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
 XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
 
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL 
+XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
 	xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL 
+XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
 	xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
 
 /** DOC_DISABLE */

Modified: trunk/include/libxml/relaxng.h
==============================================================================
--- trunk/include/libxml/relaxng.h	(original)
+++ trunk/include/libxml/relaxng.h	Fri Apr 11 13:58:43 2008
@@ -25,11 +25,28 @@
 
 
 /**
- * A schemas validation context
+ * xmlRelaxNGValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from a Relax-NG validation
  */
 typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlRelaxNGValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from a Relax-NG validation
+ */
 typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
 
+/**
+ * A schemas validation context
+ */
 typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
 typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
 

Modified: trunk/include/libxml/schematron.h
==============================================================================
--- trunk/include/libxml/schematron.h	(original)
+++ trunk/include/libxml/schematron.h	Fri Apr 11 13:58:43 2008
@@ -38,11 +38,28 @@
 typedef xmlSchematron *xmlSchematronPtr;
 
 /**
- * A schemas validation context
+ * xmlSchematronValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from a Schematron validation
  */
 typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlSchematronValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from a Schematron validation
+ */
 typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
 
+/**
+ * A schemas validation context
+ */
 typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
 typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
 

Modified: trunk/include/libxml/xmlreader.h
==============================================================================
--- trunk/include/libxml/xmlreader.h	(original)
+++ trunk/include/libxml/xmlreader.h	Fri Apr 11 13:58:43 2008
@@ -42,7 +42,7 @@
  * xmlParserProperties:
  *
  * Some common options to use with xmlTextReaderSetParserProp, but it
- * is better to use xmlParserOption and the xmlReaderNewxxx and 
+ * is better to use xmlParserOption and the xmlReaderNewxxx and
  * xmlReaderForxxx APIs now.
  */
 typedef enum {
@@ -111,13 +111,13 @@
 XMLPUBFUN xmlTextReaderPtr XMLCALL
 			xmlNewTextReader	(xmlParserInputBufferPtr input,
 	                                         const char *URI);
-XMLPUBFUN xmlTextReaderPtr XMLCALL	
+XMLPUBFUN xmlTextReaderPtr XMLCALL
 			xmlNewTextReaderFilename(const char *URI);
 
-XMLPUBFUN void XMLCALL			
+XMLPUBFUN void XMLCALL
 			xmlFreeTextReader	(xmlTextReaderPtr reader);
 
-XMLPUBFUN int XMLCALL			
+XMLPUBFUN int XMLCALL
             xmlTextReaderSetup(xmlTextReaderPtr reader,
                    xmlParserInputBufferPtr input, const char *URL,
                    const char *encoding, int options);
@@ -125,120 +125,120 @@
 /*
  * Iterators
  */
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderRead	(xmlTextReaderPtr reader);
 
 #ifdef LIBXML_WRITER_ENABLED
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderReadInnerXml	(xmlTextReaderPtr reader);
-			
-XMLPUBFUN xmlChar * XMLCALL	
+
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderReadOuterXml	(xmlTextReaderPtr reader);
 #endif
 
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderReadString		(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderReadAttributeValue	(xmlTextReaderPtr reader);
 
 /*
  * Attributes of the node
  */
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderDepth	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderHasValue(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderIsDefault	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderNodeType	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderQuoteChar	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 			xmlTextReaderReadState	(xmlTextReaderPtr reader);
 XMLPUBFUN int XMLCALL
                         xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
 
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstBaseUri	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstLocalName	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstName	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstPrefix	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstXmlLang	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL	
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstString	(xmlTextReaderPtr reader,
-		    				 const xmlChar *str);
-XMLPUBFUN const xmlChar * XMLCALL	
+						 const xmlChar *str);
+XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstValue	(xmlTextReaderPtr reader);
 
 /*
  * use the Const version of the routine for
  * better performance and simpler code
  */
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderBaseUri	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderLocalName	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderName	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderPrefix	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderXmlLang	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 			xmlTextReaderValue	(xmlTextReaderPtr reader);
 
 /*
  * Methods of the XmlTextReader
  */
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderClose		(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 		    xmlTextReaderGetAttributeNo	(xmlTextReaderPtr reader,
 						 int no);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 		    xmlTextReaderGetAttribute	(xmlTextReaderPtr reader,
 						 const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 		    xmlTextReaderGetAttributeNs	(xmlTextReaderPtr reader,
 						 const xmlChar *localName,
 						 const xmlChar *namespaceURI);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL 
+XMLPUBFUN xmlParserInputBufferPtr XMLCALL
 		    xmlTextReaderGetRemainder	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL	
+XMLPUBFUN xmlChar * XMLCALL
 		    xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
 						 const xmlChar *prefix);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
 						 int no);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
 						 const xmlChar *name);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
 						 const xmlChar *localName,
 						 const xmlChar *namespaceURI);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderMoveToElement	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderNormalization	(xmlTextReaderPtr reader);
 XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstEncoding  (xmlTextReaderPtr reader);
@@ -246,14 +246,14 @@
 /*
  * Extensions
  */
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderSetParserProp	(xmlTextReaderPtr reader,
 						 int prop,
 						 int value);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderGetParserProp	(xmlTextReaderPtr reader,
 						 int prop);
-XMLPUBFUN xmlNodePtr XMLCALL	
+XMLPUBFUN xmlNodePtr XMLCALL
 		    xmlTextReaderCurrentNode	(xmlTextReaderPtr reader);
 
 XMLPUBFUN int XMLCALL
@@ -262,41 +262,41 @@
 XMLPUBFUN int XMLCALL
             xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
 
-XMLPUBFUN xmlNodePtr XMLCALL	
+XMLPUBFUN xmlNodePtr XMLCALL
 		    xmlTextReaderPreserve	(xmlTextReaderPtr reader);
 #ifdef LIBXML_PATTERN_ENABLED
-XMLPUBFUN int XMLCALL	
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
-		    				 const xmlChar *pattern,
+						 const xmlChar *pattern,
 						 const xmlChar **namespaces);
 #endif /* LIBXML_PATTERN_ENABLED */
-XMLPUBFUN xmlDocPtr XMLCALL	
+XMLPUBFUN xmlDocPtr XMLCALL
 		    xmlTextReaderCurrentDoc	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlNodePtr XMLCALL	
+XMLPUBFUN xmlNodePtr XMLCALL
 		    xmlTextReaderExpand		(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderNext		(xmlTextReaderPtr reader);
 XMLPUBFUN int XMLCALL
 		    xmlTextReaderNextSibling	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderIsValid	(xmlTextReaderPtr reader);
 #ifdef LIBXML_SCHEMAS_ENABLED
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
 						 const char *rng);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
 						 xmlRelaxNGPtr schema);
 XMLPUBFUN int XMLCALL
 		    xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader,
-		    				 const char *xsd);
+						 const char *xsd);
 XMLPUBFUN int XMLCALL
 		    xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
 						 xmlSchemaValidCtxtPtr ctxt,
 						 int options);
-XMLPUBFUN int XMLCALL		
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderSetSchema	(xmlTextReaderPtr reader,
-		    				 xmlSchemaPtr schema);
+						 xmlSchemaPtr schema);
 #endif
 XMLPUBFUN const xmlChar * XMLCALL
 		    xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
@@ -382,26 +382,36 @@
  * Error handling extensions
  */
 typedef void *  xmlTextReaderLocatorPtr;
-typedef void   (XMLCALL *xmlTextReaderErrorFunc)        (void *arg, 
+
+/**
+ * xmlTextReaderErrorFunc:
+ * @arg: the user argument
+ * @msg: the message
+ * @severity: the severity of the error
+ * @locator: a locator indicating where the error occured
+ *
+ * Signature of an error callback from a reader parser
+ */
+typedef void   (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
 						 const char *msg,
 						 xmlParserSeverities severity,
 						 xmlTextReaderLocatorPtr locator);
-XMLPUBFUN int XMLCALL             
+XMLPUBFUN int XMLCALL
 		    xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
 /*int             xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
-XMLPUBFUN xmlChar * XMLCALL       
+XMLPUBFUN xmlChar * XMLCALL
 		    xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
-XMLPUBFUN void XMLCALL            
-		    xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, 
-						 xmlTextReaderErrorFunc f, 
+XMLPUBFUN void XMLCALL
+		    xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
+						 xmlTextReaderErrorFunc f,
 						 void *arg);
 XMLPUBFUN void XMLCALL
 		    xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
 							   xmlStructuredErrorFunc f,
 							   void *arg);
-XMLPUBFUN void XMLCALL            
-		    xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, 
-						 xmlTextReaderErrorFunc *f, 
+XMLPUBFUN void XMLCALL
+		    xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
+						 xmlTextReaderErrorFunc *f,
 						 void **arg);
 
 #ifdef __cplusplus

Modified: trunk/include/libxml/xmlregexp.h
==============================================================================
--- trunk/include/libxml/xmlregexp.h	(original)
+++ trunk/include/libxml/xmlregexp.h	Fri Apr 11 13:58:43 2008
@@ -38,7 +38,7 @@
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 #include <libxml/tree.h>
 #include <libxml/dict.h>
 #ifdef __cplusplus
@@ -51,16 +51,22 @@
 XMLPUBFUN xmlRegexpPtr XMLCALL
 		    xmlRegexpCompile	(const xmlChar *regexp);
 XMLPUBFUN void XMLCALL			 xmlRegFreeRegexp(xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL			
+XMLPUBFUN int XMLCALL
 		    xmlRegexpExec	(xmlRegexpPtr comp,
 					 const xmlChar *value);
-XMLPUBFUN void XMLCALL			
-    		    xmlRegexpPrint	(FILE *output,
+XMLPUBFUN void XMLCALL
+		    xmlRegexpPrint	(FILE *output,
 					 xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL			
+XMLPUBFUN int XMLCALL
 		    xmlRegexpIsDeterminist(xmlRegexpPtr comp);
 
-/*
+/**
+ * xmlRegExecCallbacks:
+ * @exec: the regular expression context
+ * @token: the current token string
+ * @transdata: transition data
+ * @inputdata: input data
+ *
  * Callback function when doing a transition in the automata
  */
 typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
@@ -71,17 +77,17 @@
 /*
  * The progressive API
  */
-XMLPUBFUN xmlRegExecCtxtPtr XMLCALL	
-    		    xmlRegNewExecCtxt	(xmlRegexpPtr comp,
+XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
+		    xmlRegNewExecCtxt	(xmlRegexpPtr comp,
 					 xmlRegExecCallbacks callback,
 					 void *data);
-XMLPUBFUN void XMLCALL			
+XMLPUBFUN void XMLCALL
 		    xmlRegFreeExecCtxt	(xmlRegExecCtxtPtr exec);
-XMLPUBFUN int XMLCALL			
-    		    xmlRegExecPushString(xmlRegExecCtxtPtr exec,
+XMLPUBFUN int XMLCALL
+		    xmlRegExecPushString(xmlRegExecCtxtPtr exec,
 					 const xmlChar *value,
 					 void *data);
-XMLPUBFUN int XMLCALL			
+XMLPUBFUN int XMLCALL
 		    xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
 					 const xmlChar *value,
 					 const xmlChar *value2,
@@ -89,15 +95,15 @@
 
 XMLPUBFUN int XMLCALL
 		    xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
-		    			 int *nbval,
-		    			 int *nbneg,
+					 int *nbval,
+					 int *nbneg,
 					 xmlChar **values,
 					 int *terminal);
 XMLPUBFUN int XMLCALL
 		    xmlRegExecErrInfo	(xmlRegExecCtxtPtr exec,
-		    			 const xmlChar **string,
+					 const xmlChar **string,
 					 int *nbval,
-		    			 int *nbneg,
+					 int *nbneg,
 					 xmlChar **values,
 					 int *terminal);
 #ifdef LIBXML_EXPR_ENABLED
@@ -135,7 +141,7 @@
 } xmlExpNodeType;
 
 /*
- * 2 core expressions shared by all for the empty language set 
+ * 2 core expressions shared by all for the empty language set
  * and for the set with just the empty token
  */
 XMLPUBVAR xmlExpNodePtr forbiddenExp;
@@ -209,7 +215,7 @@
 #endif /* LIBXML_EXPR_ENABLED */
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 #endif /* LIBXML_REGEXP_ENABLED */
 

Modified: trunk/include/libxml/xmlschemas.h
==============================================================================
--- trunk/include/libxml/xmlschemas.h	(original)
+++ trunk/include/libxml/xmlschemas.h	Fri Apr 11 13:58:43 2008
@@ -56,7 +56,7 @@
 
 /*
 * ATTENTION: Change xmlSchemaSetValidOptions's check
-* for invalid values, if adding to the validation 
+* for invalid values, if adding to the validation
 * options below.
 */
 /**
@@ -85,11 +85,28 @@
 typedef xmlSchema *xmlSchemaPtr;
 
 /**
- * A schemas validation context
+ * xmlSchemaValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from an XSD validation
  */
 typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlSchemaValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from an XSD validation
+ */
 typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
 
+/**
+ * A schemas validation context
+ */
 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
 
@@ -99,16 +116,16 @@
 /*
  * Interfaces for parsing.
  */
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL 
+XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
 	    xmlSchemaNewParserCtxt	(const char *URL);
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL 
+XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
 	    xmlSchemaNewMemParserCtxt	(const char *buffer,
 					 int size);
 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
 	    xmlSchemaNewDocParserCtxt	(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL		
+XMLPUBFUN void XMLCALL
 	    xmlSchemaFreeParserCtxt	(xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL		
+XMLPUBFUN void XMLCALL
 	    xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt,
 					 xmlSchemaValidityErrorFunc err,
 					 xmlSchemaValidityWarningFunc warn,
@@ -125,19 +142,19 @@
 XMLPUBFUN int XMLCALL
 		xmlSchemaIsValid	(xmlSchemaValidCtxtPtr ctxt);
 
-XMLPUBFUN xmlSchemaPtr XMLCALL	
+XMLPUBFUN xmlSchemaPtr XMLCALL
 	    xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL		
+XMLPUBFUN void XMLCALL
 	    xmlSchemaFree		(xmlSchemaPtr schema);
 #ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		
+XMLPUBFUN void XMLCALL
 	    xmlSchemaDump		(FILE *output,
 					 xmlSchemaPtr schema);
 #endif /* LIBXML_OUTPUT_ENABLED */
 /*
  * Interfaces for validating
  */
-XMLPUBFUN void XMLCALL		
+XMLPUBFUN void XMLCALL
 	    xmlSchemaSetValidErrors	(xmlSchemaValidCtxtPtr ctxt,
 					 xmlSchemaValidityErrorFunc err,
 					 xmlSchemaValidityWarningFunc warn,
@@ -157,11 +174,11 @@
 XMLPUBFUN int XMLCALL
 	    xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
 
-XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL	
+XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
 	    xmlSchemaNewValidCtxt	(xmlSchemaPtr schema);
-XMLPUBFUN void XMLCALL			
+XMLPUBFUN void XMLCALL
 	    xmlSchemaFreeValidCtxt	(xmlSchemaValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
+XMLPUBFUN int XMLCALL
 	    xmlSchemaValidateDoc	(xmlSchemaValidCtxtPtr ctxt,
 					 xmlDocPtr instance);
 XMLPUBFUN int XMLCALL
@@ -178,8 +195,11 @@
 					 const char * filename,
 					 int options);
 
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+	    xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
+
 /*
- * Interface to insert Schemas SAX velidation in a SAX stream
+ * Interface to insert Schemas SAX validation in a SAX stream
  */
 typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
 typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;

Modified: trunk/python/libxml2class.txt
==============================================================================
--- trunk/python/libxml2class.txt	(original)
+++ trunk/python/libxml2class.txt	Fri Apr 11 13:58:43 2008
@@ -1140,6 +1140,7 @@
     schemaIsValid()
     schemaSetValidOptions()
     schemaValidCtxtGetOptions()
+    schemaValidCtxtGetParserCtxt()
     schemaValidateDoc()
     schemaValidateFile()
     schemaValidateOneElement()

Modified: trunk/testapi.c
==============================================================================
--- trunk/testapi.c	(original)
+++ trunk/testapi.c	Fri Apr 11 13:58:43 2008
@@ -34116,6 +34116,40 @@
 
 
 static int
+test_xmlSchemaValidCtxtGetParserCtxt(void) {
+    int test_ret = 0;
+
+#if defined(LIBXML_SCHEMAS_ENABLED)
+    int mem_base;
+    xmlParserCtxtPtr ret_val;
+    xmlSchemaValidCtxtPtr ctxt; /*  */
+    int n_ctxt;
+
+    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
+        mem_base = xmlMemBlocks();
+        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
+
+        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
+        desret_xmlParserCtxtPtr(ret_val);
+        call_tests++;
+        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
+        xmlResetLastError();
+        if (mem_base != xmlMemBlocks()) {
+            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
+	           xmlMemBlocks() - mem_base);
+	    test_ret++;
+            printf(" %d", n_ctxt);
+            printf("\n");
+        }
+    }
+    function_tests++;
+#endif
+
+    return(test_ret);
+}
+
+
+static int
 test_xmlSchemaValidateDoc(void) {
     int test_ret = 0;
 
@@ -34310,7 +34344,7 @@
 test_xmlschemas(void) {
     int test_ret = 0;
 
-    if (quiet == 0) printf("Testing xmlschemas : 14 of 24 functions ...\n");
+    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
     test_ret += test_xmlSchemaDump();
     test_ret += test_xmlSchemaGetParserErrors();
     test_ret += test_xmlSchemaGetValidErrors();
@@ -34328,6 +34362,7 @@
     test_ret += test_xmlSchemaSetValidOptions();
     test_ret += test_xmlSchemaSetValidStructuredErrors();
     test_ret += test_xmlSchemaValidCtxtGetOptions();
+    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
     test_ret += test_xmlSchemaValidateDoc();
     test_ret += test_xmlSchemaValidateFile();
     test_ret += test_xmlSchemaValidateOneElement();

Modified: trunk/threads.c
==============================================================================
--- trunk/threads.c	(original)
+++ trunk/threads.c	Fri Apr 11 13:58:43 2008
@@ -1,5 +1,5 @@
 /**
- * threads.c: set of generic threading related routines 
+ * threads.c: set of generic threading related routines
  *
  * See Copyright for the status of this software.
  *

Modified: trunk/win32/libxml2.def.src
==============================================================================
Binary files. No diff available.

Modified: trunk/xmlschemas.c
==============================================================================
--- trunk/xmlschemas.c	(original)
+++ trunk/xmlschemas.c	Fri Apr 11 13:58:43 2008
@@ -90,7 +90,7 @@
  #ifndef DEBUG_IDC_NODE_TABLE
   #define DEBUG_IDC_NODE_TABLE
  #endif
-#endif   
+#endif
 
 /* #define ENABLE_PARTICLE_RESTRICTION 1 */
 
@@ -374,7 +374,7 @@
 #define XML_SCHEMA_SCHEMA_REDEFINE 3
 
 /**
- * xmlSchemaSchemaRelation: 
+ * xmlSchemaSchemaRelation:
  *
  * Used to create a graph of schema relationships.
  */
@@ -402,12 +402,12 @@
     int parsed;
     int imported;
     int preserveDoc;
-    xmlSchemaItemListPtr globals; /* Global components. */ 
+    xmlSchemaItemListPtr globals; /* Global components. */
     xmlSchemaItemListPtr locals; /* Local components. */
 };
 
 /**
- * xmlSchemaImport: 
+ * xmlSchemaImport:
  * (extends xmlSchemaBucket)
  *
  * Reflects a schema. Holds some information
@@ -422,9 +422,9 @@
     const xmlChar *schemaLocation; /* The URI of the schema document. */
     /* For chameleon includes, @origTargetNamespace will be NULL */
     const xmlChar *origTargetNamespace;
-    /* 
+    /*
     * For chameleon includes, @targetNamespace will be the
-    * targetNamespace of the including schema. 
+    * targetNamespace of the including schema.
     */
     const xmlChar *targetNamespace;
     xmlDocPtr doc; /* The schema node-tree. */
@@ -457,7 +457,7 @@
     int parsed;
     int imported;
     int preserveDoc;
-    xmlSchemaItemListPtr globals; /* Global components. */ 
+    xmlSchemaItemListPtr globals; /* Global components. */
     xmlSchemaItemListPtr locals; /* Local components. */
 
     /* The owning main or import schema bucket. */
@@ -517,7 +517,7 @@
     xmlSchemaTypeType type;
     xmlSchemaAnnotPtr annot;
     xmlSchemaAttributeUsePtr next; /* The next attr. use. */
-    /* 
+    /*
     * The attr. decl. OR a QName-ref. to an attr. decl. OR
     * a QName-ref. to an attribute group definition.
     */
@@ -573,7 +573,7 @@
     xmlDictPtr dict;
     xmlSchemaItemListPtr buckets; /* List of schema buckets. */
     /* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
-    xmlSchemaBucketPtr bucket; /* The current schema bucket */    
+    xmlSchemaBucketPtr bucket; /* The current schema bucket */
     xmlSchemaItemListPtr pending; /* All Components of all schemas that
                                      need to be fixed. */
     xmlHashTablePtr substGroups;
@@ -629,7 +629,7 @@
     xmlSchemaBucketPtr redefined; /* The schema to be redefined. */
 
     xmlSchemaRedefPtr redef; /* Used for redefinitions. */
-    int redefCounter; /* Used for redefinitions. */ 
+    int redefCounter; /* Used for redefinitions. */
     xmlSchemaItemListPtr attrProhibs;
 };
 
@@ -783,7 +783,7 @@
     xmlNodePtr node;
     xmlSchemaPSVIIDCKeyPtr *keys;
     int nodeLine;
-    int nodeQNameID;    
+    int nodeQNameID;
 
 };
 
@@ -879,7 +879,7 @@
 struct _xmlSchemaNodeInfo {
     int nodeType;
     xmlNodePtr node;
-    int nodeLine;    
+    int nodeLine;
     const xmlChar *localName;
     const xmlChar *nsName;
     const xmlChar *value;
@@ -901,7 +901,7 @@
 
     const xmlChar **nsBindings; /* Namespace bindings on this element */
     int nbNsBindings;
-    int sizeNsBindings;    
+    int sizeNsBindings;
 
     int hasKeyrefs;
     int appliedXPath; /* Indicates that an XPath has been applied. */
@@ -938,7 +938,7 @@
 struct _xmlSchemaAttrInfo {
     int nodeType;
     xmlNodePtr node;
-    int nodeLine;    
+    int nodeLine;
     const xmlChar *localName;
     const xmlChar *nsName;
     const xmlChar *value;
@@ -1172,7 +1172,7 @@
 	    if (WXS_IS_COMPLEX(WXS_TYPE_CAST item))
 		return(BAD_CAST "complex type definition");
 	    else
-		return(BAD_CAST "simple type definition");	
+		return(BAD_CAST "simple type definition");
 	default:
 	    return(xmlSchemaItemTypeToStr(item->type));
     }
@@ -1300,11 +1300,11 @@
 	*buf = xmlStrcat(*buf, localName);
     } else {
 	*buf = xmlStrcat(*buf, BAD_CAST "(NULL)");
-    }    
+    }
     return ((const xmlChar *) *buf);
 }
 
-static const xmlChar*   
+static const xmlChar*
 xmlSchemaFormatQNameNs(xmlChar **buf, xmlNsPtr ns, const xmlChar *localName)
 {
     if (ns != NULL)
@@ -1480,16 +1480,16 @@
     int list;
     xmlSchemaValType valType;
     const xmlChar *value, *value2 = NULL;
-    
+
 
     if ((retValue == NULL) || (val == NULL))
 	return (-1);
     list = xmlSchemaValueGetNext(val) ? 1 : 0;
     *retValue = NULL;
     do {
-	value = NULL;	
-	valType = xmlSchemaGetValType(val);    
-	switch (valType) {	    
+	value = NULL;
+	valType = xmlSchemaGetValType(val);
+	switch (valType) {
 	    case XML_SCHEMAS_STRING:
 	    case XML_SCHEMAS_NORMSTRING:
 	    case XML_SCHEMAS_ANYSIMPLETYPE:
@@ -1502,7 +1502,7 @@
 		    if (value2 != NULL)
 			value = value2;
 		}
-		break;	   
+		break;
 	    default:
 		if (xmlSchemaGetCanonValue(val, &value2) == -1) {
 		    if (value2 != NULL)
@@ -1540,29 +1540,29 @@
  * @buf: the string buffer
  * @itemDes: the designation of the item
  * @itemName: the name of the item
- * @item: the item as an object 
+ * @item: the item as an object
  * @itemNode: the node of the item
  * @local: the local name
  * @parsing: if the function is used during the parse
  *
  * Returns a representation of the given item used
- * for error reports. 
+ * for error reports.
  *
- * The following order is used to build the resulting 
+ * The following order is used to build the resulting
  * designation if the arguments are not NULL:
  * 1a. If itemDes not NULL -> itemDes
  * 1b. If (itemDes not NULL) and (itemName not NULL)
  *     -> itemDes + itemName
  * 2. If the preceding was NULL and (item not NULL) -> item
  * 3. If the preceding was NULL and (itemNode not NULL) -> itemNode
- * 
+ *
  * If the itemNode is an attribute node, the name of the attribute
  * will be appended to the result.
  *
  * Returns the formatted string and sets @buf to the resulting value.
- */  
-static xmlChar*   
-xmlSchemaFormatItemForReport(xmlChar **buf,		     
+ */
+static xmlChar*
+xmlSchemaFormatItemForReport(xmlChar **buf,
 		     const xmlChar *itemDes,
 		     xmlSchemaBasicItemPtr item,
 		     xmlNodePtr itemNode)
@@ -1574,9 +1574,9 @@
 	xmlFree(*buf);
 	*buf = NULL;
     }
-            
+
     if (itemDes != NULL) {
-	*buf = xmlStrdup(itemDes);	
+	*buf = xmlStrdup(itemDes);
     } else if (item != NULL) {
 	switch (item->type) {
 	case XML_SCHEMA_TYPE_BASIC: {
@@ -1634,7 +1634,7 @@
 	    break;
 	case XML_SCHEMA_TYPE_ATTRIBUTE_USE: {
 		xmlSchemaAttributeUsePtr ause;
-	    
+
 		ause = WXS_ATTR_USE_CAST item;
 		*buf = xmlStrdup(BAD_CAST "attribute use ");
 		if (WXS_ATTRUSE_DECL(ause) != NULL) {
@@ -1650,7 +1650,7 @@
 	    break;
 	case XML_SCHEMA_TYPE_ATTRIBUTE: {
 		xmlSchemaAttributePtr attr;
-	    
+
 		attr = (xmlSchemaAttributePtr) item;
 		*buf = xmlStrdup(BAD_CAST "attribute decl.");
 		*buf = xmlStrcat(*buf, BAD_CAST " '");
@@ -1666,7 +1666,7 @@
 	case XML_SCHEMA_TYPE_ELEMENT: {
 		xmlSchemaElementPtr elem;
 
-		elem = (xmlSchemaElementPtr) item;	    
+		elem = (xmlSchemaElementPtr) item;
 		*buf = xmlStrdup(BAD_CAST "element decl.");
 		*buf = xmlStrcat(*buf, BAD_CAST " '");
 		*buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str,
@@ -1676,7 +1676,7 @@
 	    break;
 	case XML_SCHEMA_TYPE_IDC_UNIQUE:
 	case XML_SCHEMA_TYPE_IDC_KEY:
-	case XML_SCHEMA_TYPE_IDC_KEYREF:		
+	case XML_SCHEMA_TYPE_IDC_KEYREF:
 	    if (item->type == XML_SCHEMA_TYPE_IDC_UNIQUE)
 		*buf = xmlStrdup(BAD_CAST "unique '");
 	    else if (item->type == XML_SCHEMA_TYPE_IDC_KEY)
@@ -1732,7 +1732,7 @@
 	default:
 	    named = 0;
 	}
-    } else 
+    } else
 	named = 0;
 
     if ((named == 0) && (itemNode != NULL)) {
@@ -1740,7 +1740,7 @@
 
 	if (itemNode->type == XML_ATTRIBUTE_NODE)
 	    elem = itemNode->parent;
-	else 
+	else
 	    elem = itemNode;
 	*buf = xmlStrdup(BAD_CAST "Element '");
 	if (elem->ns != NULL) {
@@ -1750,7 +1750,7 @@
 	} else
 	    *buf = xmlStrcat(*buf, elem->name);
 	*buf = xmlStrcat(*buf, BAD_CAST "'");
-	
+
     }
     if ((itemNode != NULL) && (itemNode->type == XML_ATTRIBUTE_NODE)) {
 	*buf = xmlStrcat(*buf, BAD_CAST ", attribute '");
@@ -1763,7 +1763,7 @@
 	*buf = xmlStrcat(*buf, BAD_CAST "'");
     }
     FREE_AND_NULL(str)
-    
+
     return (*buf);
 }
 
@@ -1786,13 +1786,13 @@
     int res, found = 0;
 
     if (*buf != NULL)
-	xmlFree(*buf);    
+	xmlFree(*buf);
     *buf = NULL;
 
     do {
 	/*
 	* Use the whitespace type of the base type.
-	*/	
+	*/
 	ws = xmlSchemaGetWhiteSpaceFacetValue(type->baseType);
 	for (facet = type->facets; facet != NULL; facet = facet->next) {
 	    if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
@@ -1881,7 +1881,7 @@
  * @msg: the error message
  * @str1: extra data
  * @str2: extra data
- * 
+ *
  * Handle a parser error
  */
 static void
@@ -1914,7 +1914,7 @@
  * @msg: the error message
  * @str1: extra data
  * @str2: extra data
- * 
+ *
  * Handle a parser error
  */
 static void
@@ -1933,7 +1933,7 @@
  * xmlSchemaPErrExt:
  * @ctxt: the parsing context
  * @node: the context node
- * @error: the error code 
+ * @error: the error code
  * @strData1: extra data
  * @strData2: extra data
  * @strData3: extra data
@@ -1943,13 +1943,13 @@
  * @str3:  extra parameter for the message display
  * @str4:  extra parameter for the message display
  * @str5:  extra parameter for the message display
- * 
+ *
  * Handle a parser error
  */
 static void
 xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
-		const xmlChar * strData1, const xmlChar * strData2, 
-		const xmlChar * strData3, const char *msg, const xmlChar * str1, 
+		const xmlChar * strData1, const xmlChar * strData2,
+		const xmlChar * strData3, const char *msg, const xmlChar * str1,
 		const xmlChar * str2, const xmlChar * str3, const xmlChar * str4,
 		const xmlChar * str5)
 {
@@ -1967,8 +1967,8 @@
     }
     __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
                     error, XML_ERR_ERROR, NULL, 0,
-                    (const char *) strData1, (const char *) strData2, 
-		    (const char *) strData3, 0, 0, msg, str1, str2, 
+                    (const char *) strData1, (const char *) strData2,
+		    (const char *) strData3, 0, 0, msg, str1, str2,
 		    str3, str4, str5);
 }
 
@@ -2016,7 +2016,7 @@
  * @str1: extra data
  * @str2: extra data
  * @str3: extra data
- * 
+ *
  * Handle a validation error
  */
 static void
@@ -2028,8 +2028,8 @@
 {
     xmlStructuredErrorFunc schannel = NULL;
     xmlGenericErrorFunc channel = NULL;
-    void *data = NULL;    
-    
+    void *data = NULL;
+
     if (ctxt != NULL) {
 	if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
 	    xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
@@ -2037,7 +2037,7 @@
 	    if (errorLevel != XML_ERR_WARNING) {
 		vctxt->nberrors++;
 		vctxt->err = error;
-		channel = vctxt->error;		
+		channel = vctxt->error;
 	    } else {
 		channel = vctxt->warning;
 	    }
@@ -2077,7 +2077,7 @@
 		else if ((vctxt->parserCtxt != NULL) &&
 		    (vctxt->parserCtxt->input != NULL))
 		    file = vctxt->parserCtxt->input->filename;
-	    }	       
+	    }
 	    __xmlRaiseError(schannel, channel, data, ctxt,
 		node, XML_FROM_SCHEMASV,
 		error, errorLevel, file, line,
@@ -2089,7 +2089,7 @@
 	    if (errorLevel != XML_ERR_WARNING) {
 		pctxt->nberrors++;
 		pctxt->err = error;
-		channel = pctxt->error;		
+		channel = pctxt->error;
 	    } else {
 		channel = pctxt->warning;
 	    }
@@ -2115,11 +2115,11 @@
  * @str1: extra data
  * @str2: extra data
  * @str3: extra data
- * 
+ *
  * Handle a validation error
  */
 static void
-xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,  
+xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
 	      int error, xmlNodePtr node, const char *msg,
 	      const xmlChar *str1, const xmlChar *str2, const xmlChar *str3)
 {
@@ -2128,7 +2128,7 @@
 }
 
 static void
-xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,  
+xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
 	      int error, xmlNodePtr node, const char *msg,
 	      const xmlChar *str1, const xmlChar *str2,
 	      const xmlChar *str3, const xmlChar *str4)
@@ -2157,7 +2157,7 @@
 	(node->type != XML_ELEMENT_NODE) &&
 	(node->type != XML_ATTRIBUTE_NODE))
     {
-	/* 
+	/*
 	* Don't try to format other nodes than element and
 	* attribute nodes.
 	* Play save and return an empty string.
@@ -2171,7 +2171,7 @@
 	*/
 	if (node->type == XML_ATTRIBUTE_NODE) {
 	    xmlNodePtr elem = node->parent;
-	    
+
 	    *msg = xmlStrdup(BAD_CAST "Element '");
 	    if (elem->ns != NULL)
 		*msg = xmlStrcat(*msg, xmlSchemaFormatQName(&str,
@@ -2181,7 +2181,7 @@
 		    NULL, elem->name));
 	    FREE_AND_NULL(str);
 	    *msg = xmlStrcat(*msg, BAD_CAST "', ");
-	    *msg = xmlStrcat(*msg, BAD_CAST "attribute '");	    
+	    *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
 	} else {
 	    *msg = xmlStrdup(BAD_CAST "Element '");
 	}
@@ -2197,7 +2197,7 @@
 	xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) actxt;
 	/*
 	* Work on node infos.
-	*/	
+	*/
 	if (vctxt->inode->nodeType == XML_ATTRIBUTE_NODE) {
 	    xmlSchemaNodeInfoPtr ielem =
 		vctxt->elemInfos[vctxt->depth];
@@ -2207,7 +2207,7 @@
 		ielem->nsName, ielem->localName));
 	    FREE_AND_NULL(str);
 	    *msg = xmlStrcat(*msg, BAD_CAST "', ");
-	    *msg = xmlStrcat(*msg, BAD_CAST "attribute '");	    
+	    *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
 	} else {
 	    *msg = xmlStrdup(BAD_CAST "Element '");
 	}
@@ -2216,7 +2216,7 @@
 	FREE_AND_NULL(str);
 	*msg = xmlStrcat(*msg, BAD_CAST "': ");
     } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
-	/* 
+	/*
 	* Hmm, no node while parsing?
 	* Return an empty string, in case NULL will break something.
 	*/
@@ -2254,7 +2254,7 @@
         return;
     msg = xmlStrdup(BAD_CAST "Internal error: ");
     msg = xmlStrcat(msg, BAD_CAST funcName);
-    msg = xmlStrcat(msg, BAD_CAST ", ");    
+    msg = xmlStrcat(msg, BAD_CAST ", ");
     msg = xmlStrcat(msg, BAD_CAST message);
     msg = xmlStrcat(msg, BAD_CAST ".\n");
 
@@ -2262,7 +2262,7 @@
 	xmlSchemaErr(actxt, XML_SCHEMAV_INTERNAL, NULL,
 	    (const char *) msg, str1, str2);
 
-    else if (actxt->type == XML_SCHEMA_CTXT_PARSER)	
+    else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
 	xmlSchemaErr(actxt, XML_SCHEMAP_INTERNAL, NULL,
 	    (const char *) msg, str1, str2);
 
@@ -2309,7 +2309,7 @@
     } else
 	xmlSchemaFormatNodeForError(&msg, actxt, node);
     msg = xmlStrcat(msg, (const xmlChar *) message);
-    msg = xmlStrcat(msg, BAD_CAST ".\n");   
+    msg = xmlStrcat(msg, BAD_CAST ".\n");
     xmlSchemaErr4(actxt, error, node,
 	(const char *) msg, str1, str2, str3, str4);
     FREE_AND_NULL(msg)
@@ -2325,7 +2325,7 @@
 		   const xmlChar *str2)
 {
     xmlSchemaCustomErr4(actxt, error, node, item,
-	message, str1, str2, NULL, NULL);    
+	message, str1, str2, NULL, NULL);
 }
 
 
@@ -2344,8 +2344,8 @@
 
     xmlSchemaFormatNodeForError(&msg, actxt, node);
     msg = xmlStrcat(msg, (const xmlChar *) message);
-    msg = xmlStrcat(msg, BAD_CAST ".\n"); 
-    
+    msg = xmlStrcat(msg, BAD_CAST ".\n");
+
     /* URGENT TODO: Set the error code to something sane. */
     xmlSchemaErr4Line(actxt, XML_ERR_WARNING, error, node, 0,
 	(const char *) msg, str1, str2, str3, NULL);
@@ -2365,15 +2365,15 @@
 		   const xmlChar *str2)
 {
     xmlChar *msg = NULL, *qname = NULL;
-    
-    msg = xmlStrdup(BAD_CAST "Element '%s': ");        
+
+    msg = xmlStrdup(BAD_CAST "Element '%s': ");
     msg = xmlStrcat(msg, (const xmlChar *) message);
     msg = xmlStrcat(msg, BAD_CAST ".\n");
     xmlSchemaErr4Line(ACTXT_CAST vctxt, XML_ERR_ERROR,
 	error, NULL, idcNode->nodeLine, (const char *) msg,
 	xmlSchemaFormatQName(&qname,
 	    vctxt->nodeQNames->items[idcNode->nodeQNameID +1],
-	    vctxt->nodeQNames->items[idcNode->nodeQNameID]), 
+	    vctxt->nodeQNames->items[idcNode->nodeQNameID]),
 	str1, str2, NULL);
     FREE_AND_NULL(qname);
     FREE_AND_NULL(msg);
@@ -2456,7 +2456,7 @@
 	if (type->builtInType != 0) {
 	    msg = xmlStrcat(msg, BAD_CAST "xs:");
 	    msg = xmlStrcat(msg, type->name);
-	} else 
+	} else
 	    msg = xmlStrcat(msg,
 		xmlSchemaFormatQName(&str,
 		    type->targetNamespace, type->name));
@@ -2494,12 +2494,12 @@
 			xmlNodePtr node)
 {
     xmlChar *msg = NULL, *str = NULL;
-    
+
     xmlSchemaFormatNodeForError(&msg, actxt, node);
     msg = xmlStrcat(msg, BAD_CAST "The attribute '%s' is not allowed.\n");
     xmlSchemaErr(actxt, error, node, (const char *) msg,
 	xmlSchemaFormatErrorNodeQName(&str, (xmlSchemaNodeInfoPtr) ni, node),
-	NULL);        
+	NULL);
     FREE_AND_NULL(str)
     FREE_AND_NULL(msg)
 }
@@ -2518,7 +2518,7 @@
     xmlChar *localName, *nsName;
     const xmlChar *cur, *end;
     int i;
-    
+
     xmlSchemaFormatNodeForError(&msg, actxt, node);
     msg = xmlStrcat(msg, (const xmlChar *) message);
     msg = xmlStrcat(msg, BAD_CAST ".");
@@ -2533,7 +2533,7 @@
 	} else
 	    str = xmlStrdup(BAD_CAST " Expected is ( ");
 	nsName = NULL;
-    	    
+
 	for (i = 0; i < nbval + nbneg; i++) {
 	    cur = values[i];
 	    if (cur == NULL)
@@ -2547,7 +2547,7 @@
 	    * Get the local name.
 	    */
 	    localName = NULL;
-	    
+
 	    end = cur;
 	    if (*end == '*') {
 		localName = xmlStrdup(BAD_CAST "*");
@@ -2556,8 +2556,8 @@
 		while ((*end != 0) && (*end != '|'))
 		    end++;
 		localName = xmlStrncat(localName, BAD_CAST cur, end - cur);
-	    }		
-	    if (*end != 0) {		    
+	    }
+	    if (*end != 0) {
 		end++;
 		/*
 		* Skip "*|*" if they come with negated expressions, since
@@ -2573,12 +2573,12 @@
 		    } else {
 			while (*end != 0)
 			    end++;
-			
+
 			if (i >= nbval)
 			    nsName = xmlStrdup(BAD_CAST "{##other:");
 			else
 			    nsName = xmlStrdup(BAD_CAST "{");
-			
+
 			nsName = xmlStrncat(nsName, BAD_CAST cur, end - cur);
 			nsName = xmlStrcat(nsName, BAD_CAST "}");
 		    }
@@ -2588,13 +2588,13 @@
 		    FREE_AND_NULL(localName);
 		    continue;
 		}
-	    }	        
+	    }
 	    str = xmlStrcat(str, BAD_CAST localName);
 	    FREE_AND_NULL(localName);
-		
+
 	    if (i < nbval + nbneg -1)
 		str = xmlStrcat(str, BAD_CAST ", ");
-	}	
+	}
 	str = xmlStrcat(str, BAD_CAST " ).\n");
 	msg = xmlStrcat(msg, BAD_CAST str);
 	FREE_AND_NULL(str)
@@ -2626,8 +2626,8 @@
 	/*
 	* If enumerations are validated, one must not expect the
 	* facet to be given.
-	*/	
-    } else	
+	*/
+    } else
 	facetType = facet->type;
     msg = xmlStrcat(msg, BAD_CAST "[");
     msg = xmlStrcat(msg, BAD_CAST "facet '");
@@ -2655,31 +2655,31 @@
 	    snprintf(actLen, 24, "%lu", length);
 
 	    if (facetType == XML_SCHEMA_FACET_LENGTH)
-		msg = xmlStrcat(msg, 
-		BAD_CAST "this differs from the allowed length of '%s'.\n");     
+		msg = xmlStrcat(msg,
+		BAD_CAST "this differs from the allowed length of '%s'.\n");
 	    else if (facetType == XML_SCHEMA_FACET_MAXLENGTH)
-		msg = xmlStrcat(msg, 
+		msg = xmlStrcat(msg,
 		BAD_CAST "this exceeds the allowed maximum length of '%s'.\n");
 	    else if (facetType == XML_SCHEMA_FACET_MINLENGTH)
-		msg = xmlStrcat(msg, 
+		msg = xmlStrcat(msg,
 		BAD_CAST "this underruns the allowed minimum length of '%s'.\n");
-	    
+
 	    if (nodeType == XML_ATTRIBUTE_NODE)
 		xmlSchemaErr3(actxt, error, node, (const char *) msg,
 		    value, (const xmlChar *) actLen, (const xmlChar *) len);
-	    else 
+	    else
 		xmlSchemaErr(actxt, error, node, (const char *) msg,
 		    (const xmlChar *) actLen, (const xmlChar *) len);
-	
+
 	} else if (facetType == XML_SCHEMA_FACET_ENUMERATION) {
 	    msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not an element "
 		"of the set {%s}.\n");
-	    xmlSchemaErr(actxt, error, node, (const char *) msg, value, 
+	    xmlSchemaErr(actxt, error, node, (const char *) msg, value,
 		xmlSchemaFormatFacetEnumSet(actxt, &str, type));
 	} else if (facetType == XML_SCHEMA_FACET_PATTERN) {
 	    msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not accepted "
 		"by the pattern '%s'.\n");
-	    xmlSchemaErr(actxt, error, node, (const char *) msg, value, 
+	    xmlSchemaErr(actxt, error, node, (const char *) msg, value,
 		facet->value);
 	} else if (facetType == XML_SCHEMA_FACET_MININCLUSIVE) {
 	    msg = xmlStrcat(msg, BAD_CAST "The value '%s' is less than the "
@@ -2711,10 +2711,10 @@
 		"digits than are allowed ('%s').\n");
 	    xmlSchemaErr(actxt, error, node, (const char*) msg, value,
 		facet->value);
-	} else if (nodeType == XML_ATTRIBUTE_NODE) {		
+	} else if (nodeType == XML_ATTRIBUTE_NODE) {
 	    msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not facet-valid.\n");
-	    xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);	
-	} else {	    
+	    xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);
+	} else {
 	    msg = xmlStrcat(msg, BAD_CAST "The value is not facet-valid.\n");
 	    xmlSchemaErr(actxt, error, node, (const char *) msg, NULL, NULL);
 	}
@@ -2722,7 +2722,7 @@
 	msg = xmlStrcat(msg, (const xmlChar *) message);
 	msg = xmlStrcat(msg, BAD_CAST ".\n");
 	xmlSchemaErr(actxt, error, node, (const char *) msg, str1, str2);
-    }        
+    }
     FREE_AND_NULL(str)
     xmlFree(msg);
 }
@@ -2967,9 +2967,9 @@
 		    const xmlChar *str3,const xmlChar *str4)
 {
     xmlChar *str = NULL, *msg = NULL;
-    
+
     xmlSchemaFormatItemForReport(&msg, NULL, ownerItem, NULL);
-    msg = xmlStrcat(msg, BAD_CAST ", ");    
+    msg = xmlStrcat(msg, BAD_CAST ", ");
     msg = xmlStrcat(msg,
 	BAD_CAST xmlSchemaFormatItemForReport(&str, NULL,
 	WXS_BASIC_CAST attruse, NULL));
@@ -2977,7 +2977,7 @@
     msg = xmlStrcat(msg, BAD_CAST ": ");
     msg = xmlStrcat(msg, (const xmlChar *) message);
     msg = xmlStrcat(msg, BAD_CAST ".\n");
-    xmlSchemaErr4(ACTXT_CAST ctxt, error, node, 
+    xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
 	(const char *) msg, str1, str2, str3, str4);
     xmlFree(msg);
 }
@@ -3071,7 +3071,7 @@
  * @error: the error code
  * @type: the type specifier
  * @ownerDes: the designation of the owner
- * @ownerItem: the schema object if existent 
+ * @ownerItem: the schema object if existent
  * @node: the validated node
  * @value: the validated value
  *
@@ -3079,7 +3079,7 @@
  * TODO: Should this report the value of an element as well?
  */
 static void
-xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, 
+xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
 			xmlParserErrors error,
 			xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
 			xmlNodePtr node,
@@ -3091,37 +3091,37 @@
 			const xmlChar *str2)
 {
     xmlChar *msg = NULL;
-    
+
     xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
     if (message == NULL) {
 	/*
 	* Use default messages.
-	*/	
+	*/
 	if (type != NULL) {
 	    if (node->type == XML_ATTRIBUTE_NODE)
 		msg = xmlStrcat(msg, BAD_CAST "'%s' is not a valid value of ");
 	    else
 		msg = xmlStrcat(msg, BAD_CAST "The character content is not a "
-		"valid value of ");	
+		"valid value of ");
 	    if (! xmlSchemaIsGlobalItem(type))
 		msg = xmlStrcat(msg, BAD_CAST "the local ");
 	    else
 		msg = xmlStrcat(msg, BAD_CAST "the ");
-	    
+
 	    if (WXS_IS_ATOMIC(type))
 		msg = xmlStrcat(msg, BAD_CAST "atomic type");
 	    else if (WXS_IS_LIST(type))
 		msg = xmlStrcat(msg, BAD_CAST "list type");
 	    else if (WXS_IS_UNION(type))
 		msg = xmlStrcat(msg, BAD_CAST "union type");
-	    
+
 	    if (xmlSchemaIsGlobalItem(type)) {
 		xmlChar *str = NULL;
 		msg = xmlStrcat(msg, BAD_CAST " '");
 		if (type->builtInType != 0) {
 		    msg = xmlStrcat(msg, BAD_CAST "xs:");
 		    msg = xmlStrcat(msg, type->name);
-		} else 
+		} else
 		    msg = xmlStrcat(msg,
 			xmlSchemaFormatQName(&str,
 			    type->targetNamespace, type->name));
@@ -3134,7 +3134,7 @@
 	    else
 		msg = xmlStrcat(msg, BAD_CAST "The character content is not "
 		"valid.");
-	}	
+	}
 	if (expected) {
 	    msg = xmlStrcat(msg, BAD_CAST " Expected is '");
 	    msg = xmlStrcat(msg, BAD_CAST expected);
@@ -3151,7 +3151,7 @@
 	xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL,
 	     (const char*) msg, str1, str2, NULL, NULL, NULL);
     }
-    /* Cleanup. */    
+    /* Cleanup. */
     FREE_AND_NULL(msg)
 }
 
@@ -3372,7 +3372,7 @@
 
 static int
 xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx)
-{    
+{
     if (list->items == NULL) {
 	list->items = (void **) xmlMalloc(
 	    20 * sizeof(void *));
@@ -3412,7 +3412,7 @@
 			    int initialSize,
 			    void *item,
 			    int idx)
-{    
+{
     if (list->items == NULL) {
 	if (initialSize <= 0)
 	    initialSize = 1;
@@ -3467,7 +3467,7 @@
 	list->sizeItems = 0;
     } else if (list->nbItems -1 == idx) {
 	list->nbItems--;
-    } else {	
+    } else {
 	for (i = idx; i < list->nbItems -1; i++)
 	    list->items[i] = list->items[i+1];
 	list->nbItems--;
@@ -3502,19 +3502,19 @@
     }
     if (bucket->locals != NULL) {
 	xmlSchemaComponentListFree(bucket->locals);
-	xmlSchemaItemListFree(bucket->locals);	
+	xmlSchemaItemListFree(bucket->locals);
     }
     if (bucket->relations != NULL) {
 	xmlSchemaSchemaRelationPtr prev, cur = bucket->relations;
 	do {
-	    prev = cur;	    
+	    prev = cur;
 	    cur = cur->next;
 	    xmlFree(prev);
 	} while (cur != NULL);
     }
     if ((! bucket->preserveDoc) && (bucket->doc != NULL)) {
 	xmlFreeDoc(bucket->doc);
-    } 
+    }
     if (bucket->type == XML_SCHEMA_SCHEMA_IMPORT) {
 	if (WXS_IMPBUCKET(bucket)->schema != NULL)
 	    xmlSchemaFree(WXS_IMPBUCKET(bucket)->schema);
@@ -3559,7 +3559,7 @@
 	xmlFree(ret);
 	return(NULL);
     }
-    /* 
+    /*
     * The following will assure that only the first bucket is marked as
     * XML_SCHEMA_SCHEMA_MAIN and it points to the *main* schema.
     * For each following import buckets an xmlSchema will be created.
@@ -3573,7 +3573,7 @@
 	    xmlSchemaBucketFree(ret);
 	    return(NULL);
 	}
-	/* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */ 
+	/* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */
 	ret->type = XML_SCHEMA_SCHEMA_MAIN;
 	/* Point to the *main* schema. */
 	WXS_CONSTRUCTOR(pctxt)->mainBucket = ret;
@@ -3583,12 +3583,12 @@
 	*/
 	mainSchema->targetNamespace = targetNamespace;
     } else {
-	if (type == XML_SCHEMA_SCHEMA_MAIN) {	    
+	if (type == XML_SCHEMA_SCHEMA_MAIN) {
 	    PERROR_INT("xmlSchemaBucketCreate",
 		"main bucket but it's not the first one");
 	    xmlSchemaBucketFree(ret);
 	    return(NULL);
-	} else if (type == XML_SCHEMA_SCHEMA_IMPORT) {	    
+	} else if (type == XML_SCHEMA_SCHEMA_IMPORT) {
 	    /*
 	    * Create a schema for imports and assign the
 	    * targetNamespace.
@@ -3600,7 +3600,7 @@
 	    }
 	    WXS_IMPBUCKET(ret)->schema->targetNamespace = targetNamespace;
 	}
-    }    
+    }
     if (WXS_IS_BUCKET_IMPMAIN(type)) {
 	int res;
 	/*
@@ -3643,11 +3643,11 @@
 	    if (mainSchema->includes == NULL) {
 		xmlSchemaBucketFree(ret);
 		return(NULL);
-	    }	    
+	    }
 	}
 	xmlSchemaItemListAdd(mainSchema->includes, ret);
     }
-    /* 
+    /*
     * Add to list of all buckets; this is used for lookup
     * during schema construction time only.
     */
@@ -4015,7 +4015,7 @@
 	for (i = 0; i < list->nbItems; i++) {
 	    item = items[i];
 	    if (item == NULL)
-		continue;	    
+		continue;
 	    switch (item->type) {
 		case XML_SCHEMA_TYPE_SIMPLE:
 		case XML_SCHEMA_TYPE_COMPLEX:
@@ -4122,7 +4122,7 @@
 	xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes;
 	int i;
 	for (i = 0; i < list->nbItems; i++) {
-	    xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);	
+	    xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);
 	}
 	xmlSchemaItemListFree(list);
     }
@@ -4330,7 +4330,7 @@
 /**
  * xmlSchemaAttrUsesDump:
  * @uses:  attribute uses list
- * @output:  the file output 
+ * @output:  the file output
  *
  * Dumps a list of attribute use components.
  */
@@ -4347,7 +4347,7 @@
     if ((uses == NULL) || (uses->nbItems == 0))
         return;
 
-    fprintf(output, "  attributes:\n");    
+    fprintf(output, "  attributes:\n");
     for (i = 0; i < uses->nbItems; i++) {
 	use = uses->items[i];
 	if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
@@ -4533,7 +4533,7 @@
 	return;
     do {
 	fprintf(output, "IDC:   BINDING '%s' (%d)\n",
-	    xmlSchemaGetComponentQName(&str, 
+	    xmlSchemaGetComponentQName(&str,
 		bind->definition), bind->nbNodes);
 	FREE_AND_NULL(str)
 	for (i = 0; i < bind->nbNodes; i++) {
@@ -4634,7 +4634,7 @@
     xmlAttrPtr prop;
 
     if ((node == NULL) || (name == NULL))
-	return(NULL);    
+	return(NULL);
     prop = node->properties;
     while (prop != NULL) {
 	if ((prop->ns != NULL) &&
@@ -4729,12 +4729,12 @@
                  const xmlChar * nsName)
 {
     xmlSchemaElementPtr ret = NULL;
-    
+
     if ((name == NULL) || (schema == NULL))
         return(NULL);
     if (schema != NULL) {
 	WXS_FIND_GLOBAL_ITEM(elemDecl)
-    }   
+    }
 exit:
 #ifdef DEBUG
     if (ret == NULL) {
@@ -4765,9 +4765,9 @@
     xmlSchemaTypePtr ret = NULL;
 
     if (name == NULL)
-        return (NULL);    
+        return (NULL);
     /* First try the built-in types. */
-    if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {	
+    if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {
 	ret = xmlSchemaGetPredefinedType(name, nsName);
 	if (ret != NULL)
 	    goto exit;
@@ -4780,7 +4780,7 @@
     }
     if (schema != NULL) {
 	WXS_FIND_GLOBAL_ITEM(typeDecl)
-    } 
+    }
 exit:
 
 #ifdef DEBUG
@@ -4891,7 +4891,7 @@
 	WXS_FIND_GLOBAL_ITEM(groupDecl)
     }
 exit:
-    
+
 #ifdef DEBUG
     if (ret == NULL) {
         if (nsName == NULL)
@@ -5000,7 +5000,7 @@
 	str++;
 	len--;
     }
-    
+
     return (1);
 }
 
@@ -5061,7 +5061,7 @@
 		default:
 		    /* Should not be hit. */
 		    return(NULL);
-	    }		
+	    }
 	}
     }
 subschemas:
@@ -5209,7 +5209,7 @@
 * resolve references to the redefined components and to check constraints.
 */
 static xmlSchemaRedefPtr
-xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,		  
+xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,
 		  xmlSchemaBucketPtr targetBucket,
 		  void *item,
 		  const xmlChar *refName,
@@ -5272,7 +5272,7 @@
     ret->type = XML_SCHEMA_TYPE_ATTRIBUTEGROUP;
     ret->name = name;
     ret->targetNamespace = nsName;
-    ret->node = node;   
+    ret->node = node;
 
     /* TODO: Remove the flag. */
     ret->flags |= XML_SCHEMAS_ATTRGROUP_GLOBAL;
@@ -5282,7 +5282,7 @@
 	if (pctxt->redef == NULL) {
 	    xmlFree(ret);
 	    return(NULL);
-	}	    
+	}
 	pctxt->redefCounter = 0;
     }
     WXS_ADD_GLOBAL(pctxt, ret);
@@ -5371,13 +5371,13 @@
 	    if (ctxt->redef == NULL) {
 		xmlFree(ret);
 		return(NULL);
-	    }	    
+	    }
 	    ctxt->redefCounter = 0;
 	}
 	WXS_ADD_GLOBAL(ctxt, ret);
     } else
 	WXS_ADD_LOCAL(ctxt, ret);
-    WXS_ADD_PENDING(ctxt, ret);    
+    WXS_ADD_PENDING(ctxt, ret);
     return (ret);
 }
 
@@ -5509,7 +5509,7 @@
     ret->children = NULL;
 
     WXS_ADD_LOCAL(ctxt, ret);
-    /* 
+    /*
     * Note that addition to pending components will be done locally
     * to the specific parsing function, since the most particles
     * need not to be fixed up (i.e. the reference to be resolved).
@@ -5558,7 +5558,7 @@
 	if (ctxt->redef == NULL) {
 	    xmlFree(ret);
 	    return(NULL);
-	}	    
+	}
 	ctxt->redefCounter = 0;
     }
     WXS_ADD_GLOBAL(ctxt, ret);
@@ -5595,7 +5595,7 @@
                   const xmlChar *name, const xmlChar *nsName,
 		  int category, xmlNodePtr node)
 {
-    xmlSchemaIDCPtr ret = NULL;    
+    xmlSchemaIDCPtr ret = NULL;
 
     if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
         return (NULL);
@@ -5611,8 +5611,8 @@
     ret->targetNamespace = nsName;
     ret->name = name;
     ret->type = category;
-    ret->node = node;        
-    
+    ret->node = node;
+
     WXS_ADD_GLOBAL(ctxt, ret);
     /*
     * Only keyrefs need to be fixup up.
@@ -5648,7 +5648,7 @@
     }
     memset(ret, 0, sizeof(xmlSchemaWildcard));
     ret->type = type;
-    ret->node = node;    
+    ret->node = node;
     WXS_ADD_LOCAL(ctxt, ret);
     return (ret);
 }
@@ -5704,7 +5704,7 @@
 static xmlSchemaSubstGroupPtr
 xmlSchemaSubstGroupGet(xmlSchemaParserCtxtPtr pctxt,
 		       xmlSchemaElementPtr head)
-{   
+{
     if (WXS_SUBST_GROUPS(pctxt) == NULL)
 	return(NULL);
     return(xmlHashLookup2(WXS_SUBST_GROUPS(pctxt),
@@ -6288,7 +6288,7 @@
 	    ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
 	else
 	    ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
-	xmlSchemaPSimpleTypeErr(pctxt, 
+	xmlSchemaPSimpleTypeErr(pctxt,
 	    ret, ownerItem, (xmlNodePtr) attr,
 	    type, NULL, value, NULL, NULL, NULL);
     }
@@ -6352,7 +6352,7 @@
  * number otherwise and -1 in case of an internal or API error.
  */
 static int
-xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,		       
+xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
 		       xmlSchemaBasicItemPtr ownerItem,
 		       xmlNodePtr ownerElem,
 		       const char *name,
@@ -6442,7 +6442,7 @@
  * @type:  the hosting type where the attributes will be anchored
  *
  * Parses attribute uses and attribute declarations and
- * attribute group references. 
+ * attribute group references.
  */
 static int
 xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
@@ -7085,7 +7085,7 @@
 			     int parentType)
 {
     const xmlChar *attrValue, *name = NULL, *ns = NULL;
-    xmlSchemaAttributeUsePtr use = NULL;    
+    xmlSchemaAttributeUsePtr use = NULL;
     xmlNodePtr child = NULL;
     xmlAttrPtr attr;
     const xmlChar *tmpNs = NULL, *tmpName = NULL, *defValue = NULL;
@@ -7139,7 +7139,7 @@
 		    /*
 		    * Evaluate the target namespace
 		    */
-		    hasForm = 1;		    
+		    hasForm = 1;
 		    attrValue = xmlSchemaGetNodeContent(pctxt,
 			(xmlNodePtr) attr);
 		    if (xmlStrEqual(attrValue, BAD_CAST "qualified")) {
@@ -7210,7 +7210,7 @@
 
 attr_next:
 	attr = attr->next;
-    }        
+    }
     /*
     * 3.2.3 : 2
     * If default and use are both present, use must have
@@ -7236,7 +7236,7 @@
 
 	/* TODO: move XML_SCHEMAS_QUALIF_ATTR to the parser. */
 	if ((! hasForm) && (schema->flags & XML_SCHEMAS_QUALIF_ATTR))
-	    ns = pctxt->targetNamespace;		
+	    ns = pctxt->targetNamespace;
 	/*
 	* 3.2.6 Schema Component Constraint: xsi: Not Allowed
 	* TODO: Move this to the component layer.
@@ -7293,7 +7293,7 @@
 	use->attrDecl = attrDecl;
 	/*
 	* Value constraint.
-	*/	
+	*/
 	if (defValue != NULL) {
 	    attrDecl->defValue = defValue;
 	    if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
@@ -7333,14 +7333,14 @@
 	    if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
 		use->flags |= XML_SCHEMA_ATTR_USE_FIXED;
     }
-    
+
 check_children:
     /*
     * And now for the children...
     */
     child = node->children;
     if (occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) {
-	xmlSchemaAttributeUseProhibPtr prohib;	
+	xmlSchemaAttributeUseProhibPtr prohib;
 
 	if (IS_SCHEMA(child, "annotation")) {
 	    xmlSchemaParseAnnotation(pctxt, child, 0);
@@ -7355,7 +7355,7 @@
 	/*
 	* Check for pointlessness of attribute prohibitions.
 	*/
-	if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {		
+	if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {
 	    xmlSchemaCustomWarning(ACTXT_CAST pctxt,
 		XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
 		node, NULL,
@@ -7373,7 +7373,7 @@
 	    return(NULL);
 	}
 	if (! isRef) {
-	    tmpName = name; 
+	    tmpName = name;
 	    tmpNs = ns;
 	}
 	/*
@@ -7381,7 +7381,7 @@
 	*/
 	if (uses) {
 	    int i;
-	    
+
 	    for (i = 0; i < uses->nbItems; i++) {
 		use = uses->items[i];
 		if ((use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) &&
@@ -7389,16 +7389,16 @@
 		    (tmpNs == (WXS_ATTR_PROHIB_CAST use)->targetNamespace))
 		{
 		    xmlChar *str = NULL;
-		    
+
 		    xmlSchemaCustomWarning(ACTXT_CAST pctxt,
 			XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
 			node, NULL,
 			"Skipping duplicate attribute use prohibition '%s'",
 			xmlSchemaFormatQName(&str, tmpNs, tmpName),
 			NULL, NULL);
-		    FREE_AND_NULL(str)			
+		    FREE_AND_NULL(str)
 		    return(NULL);
-		}	
+		}
 	    }
 	}
 	/*
@@ -7417,7 +7417,7 @@
 	    WXS_ADD_PENDING(pctxt, prohib);
 	}
 	return(WXS_BASIC_CAST prohib);
-    } else {        
+    } else {
 	if (IS_SCHEMA(child, "annotation")) {
 	    /*
 	    * TODO: Should this go into the attr decl?
@@ -7464,7 +7464,7 @@
 		NULL, node, child, NULL,
 		"(annotation?, simpleType?)");
 	}
-    }   
+    }
     return (WXS_BASIC_CAST use);
 }
 
@@ -7486,7 +7486,7 @@
      * 3.2.3 Constraints on XML Representations of Attribute Declarations
      */
     if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
-        return (NULL);        
+        return (NULL);
     /*
     * 3.2.3 : 3.1
     * One of ref or name must be present, but not both
@@ -7532,7 +7532,7 @@
     if (ret == NULL)
 	return (NULL);
     ret->flags |= XML_SCHEMAS_ATTR_GLOBAL;
-	
+
     /*
     * Check for illegal attributes.
     */
@@ -7546,7 +7546,7 @@
 		(!xmlStrEqual(attr->name, BAD_CAST "type")))
 	    {
 		xmlSchemaPIllegalAttrErr(pctxt,
-		    XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);		
+		    XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
 	    }
 	} else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
 	    xmlSchemaPIllegalAttrErr(pctxt,
@@ -7556,7 +7556,7 @@
     }
     xmlSchemaPValAttrQName(pctxt, schema, NULL,
 	node, "type", &ret->typeNs, &ret->typeName);
-    
+
     xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id");
     /*
     * Attribute "fixed".
@@ -7641,12 +7641,12 @@
 	    XML_SCHEMAP_S4S_ATTR_MISSING,
 	    NULL, node, "ref", NULL);
 	return (NULL);
-    }	
+    }
     xmlSchemaPValAttrNodeQName(pctxt, schema,
 	NULL, attr, &refNs, &ref);
     if (xmlSchemaCheckReference(pctxt, schema, node, attr, refNs) != 0)
 	return(NULL);
-   
+
     /*
     * Check for illegal attributes.
     */
@@ -7704,7 +7704,7 @@
 	*/
 	if (pctxt->redefCounter != 0) {
 	    xmlChar *str = NULL;
-	    
+
 	    xmlSchemaCustomErr(ACTXT_CAST pctxt,
 		XML_SCHEMAP_SRC_REDEFINE, node, NULL,
 		"The redefining attribute group definition "
@@ -7738,7 +7738,7 @@
 	ret->node = node;
 	/* Add to pending items, to be able to resolve the reference. */
 	WXS_ADD_PENDING(pctxt, ret);
-    }    
+    }
     return (ret);
 }
 
@@ -7785,7 +7785,7 @@
     ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema,
 	name, pctxt->targetNamespace, node);
     if (ret == NULL)
-	return (NULL);	
+	return (NULL);
     /*
     * Check for illegal attributes.
     */
@@ -8185,7 +8185,7 @@
  * Returns the parsed identity-constraint definition.
  */
 static xmlSchemaIDCSelectPtr
-xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,			  
+xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
 			  xmlSchemaIDCPtr idc,
 			  xmlNodePtr node,
 			  int isField)
@@ -9195,7 +9195,7 @@
 	    if (attr->ns == NULL) {
 		if (!xmlStrEqual(attr->name, BAD_CAST "id")) {
 		    xmlSchemaPIllegalAttrErr(ctxt,
-			XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); 
+			XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
 		}
 	    } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
 		    xmlSchemaPIllegalAttrErr(ctxt,
@@ -9266,9 +9266,9 @@
     * And now for the children...
     */
     oldCtxtType = ctxt->ctxtType;
-    
+
     ctxt->ctxtType = type;
-    
+
     child = node->children;
     if (IS_SCHEMA(child, "annotation")) {
         type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
@@ -9278,10 +9278,10 @@
 	xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING,
 	    NULL, node, child, NULL,
 	    "(annotation?, (restriction | list | union))");
-    } else if (IS_SCHEMA(child, "restriction")) {	
+    } else if (IS_SCHEMA(child, "restriction")) {
         xmlSchemaParseRestriction(ctxt, schema, child,
-	    XML_SCHEMA_TYPE_SIMPLE);	
-	hasRestriction = 1;	
+	    XML_SCHEMA_TYPE_SIMPLE);
+	hasRestriction = 1;
         child = child->next;
     } else if (IS_SCHEMA(child, "list")) {
         xmlSchemaParseList(ctxt, schema, child);
@@ -9307,7 +9307,7 @@
 	    NULL, node, "This is a redefinition, thus the "
 	    "<simpleType> must have a <restriction> child", NULL);
     }
-    
+
     ctxt->ctxtType = oldCtxtType;
     return (type);
 }
@@ -9373,13 +9373,13 @@
     xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
     item = xmlSchemaAddParticle(ctxt, node, min, max);
     if (item == NULL)
-	return (NULL);    
+	return (NULL);
     /*
     * Create a qname-reference and set as the term; it will be substituted
     * for the model group after the reference has been resolved.
     */
     item->children = (xmlSchemaTreeItemPtr)
-	xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);    
+	xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
     xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max);
     /*
     * And now for the children...
@@ -9419,7 +9419,7 @@
  * Note that the contraint src-redefine (6.2) can't be applied until
  * references have been resolved. So we will do this at the
  * component fixup level.
- *    
+ *
  * *WARNING* this interface is highly subject to change
  *
  * Returns -1 in case of error, 0 if the declaration is improper and
@@ -9493,7 +9493,7 @@
 	child = child->next;
     }
 
-   
+
 
     if (child != NULL) {
 	xmlSchemaPContentErr(ctxt,
@@ -9631,7 +9631,7 @@
     attr = xmlSchemaGetPropNode(node, "version");
     if (attr != NULL) {
 	res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr,
-	    xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);    
+	    xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);
 	HFAILURE;
     }
     */
@@ -9691,7 +9691,7 @@
     }
     attr = xmlSchemaGetPropNode(node, "blockDefault");
     if (attr != NULL) {
-	val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);	
+	val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
 	res = xmlSchemaPValAttrBlockFinal(val, &(schema->flags), -1,
 	    XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION,
 	    XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION,
@@ -9752,14 +9752,14 @@
 	    HFAILURE;
 	    HSTOP(ctxt);
 	    if (tmpOldErrs != ctxt->nberrors)
-		goto exit;	    
+		goto exit;
 	} else if (IS_SCHEMA(child, "include")) {
 	    tmpOldErrs = ctxt->nberrors;
 	    res = xmlSchemaParseInclude(ctxt, schema, child);
 	    HFAILURE;
 	    HSTOP(ctxt);
 	    if (tmpOldErrs != ctxt->nberrors)
-		goto exit;	    
+		goto exit;
 	} else if (IS_SCHEMA(child, "redefine")) {
 	    tmpOldErrs = ctxt->nberrors;
 	    res = xmlSchemaParseRedefine(ctxt, schema, child);
@@ -9884,7 +9884,7 @@
     xmlFree(con);
 }
 
-static xmlSchemaConstructionCtxtPtr 
+static xmlSchemaConstructionCtxtPtr
 xmlSchemaConstructionCtxtCreate(xmlDictPtr dict)
 {
     xmlSchemaConstructionCtxtPtr ret;
@@ -9954,10 +9954,10 @@
     xmlSchemaParserCtxtPtr ret;
 
     ret = xmlSchemaParserCtxtCreate();
-    if (ret == NULL)        
+    if (ret == NULL)
         return (NULL);
     ret->dict = dict;
-    xmlDictReference(dict);    
+    xmlDictReference(dict);
     if (URL != NULL)
 	ret->URL = xmlDictLookup(dict, (const xmlChar *) URL, -1);
     return (ret);
@@ -10082,8 +10082,8 @@
     xmlNodePtr node;
     int ret, oldErrs;
     xmlSchemaBucketPtr oldbucket = pctxt->constructor->bucket;
-    
-    /* 
+
+    /*
     * Save old values; reset the *main* schema.
     * URGENT TODO: This is not good; move the per-document information
     * to the parser. Get rid of passing the main schema to the
@@ -10093,9 +10093,9 @@
     oldDoc = schema->doc;
     if (schema->flags != 0)
 	xmlSchemaClearSchemaDefaults(schema);
-    schema->doc = bucket->doc;    
+    schema->doc = bucket->doc;
     pctxt->schema = schema;
-    /* 
+    /*
     * Keep the current target namespace on the parser *not* on the
     * main schema.
     */
@@ -10108,7 +10108,7 @@
 	* We are parsing the schema for schemas!
 	*/
 	pctxt->isS4S = 1;
-    }    
+    }
     /* Mark it as parsed, even if parsing fails. */
     bucket->parsed++;
     /* Compile the schema doc. */
@@ -10132,7 +10132,7 @@
 	ret = pctxt->err;
 	goto exit;
     }
-    
+
 exit:
     WXS_CONSTRUCTOR(pctxt)->bucket = oldbucket;
     /* Restore schema values. */
@@ -10165,7 +10165,7 @@
 	PERROR_INT("xmlSchemaParseNewDoc",
 	    "no constructor");
 	return(-1);
-    }    
+    }
     /* Create and init the temporary parser context. */
     newpctxt = xmlSchemaNewParserCtxtUseDict(
 	(const char *) bucket->schemaLocation, pctxt->dict);
@@ -10173,7 +10173,7 @@
 	return(-1);
     newpctxt->constructor = pctxt->constructor;
     /*
-    * TODO: Can we avoid that the parser knows about the main schema? 
+    * TODO: Can we avoid that the parser knows about the main schema?
     * It would be better if he knows about the current schema bucket
     * only.
     */
@@ -10183,16 +10183,16 @@
     xmlSchemaSetParserStructuredErrors(newpctxt, pctxt->serror,
 	pctxt->errCtxt);
     newpctxt->counter = pctxt->counter;
-    
+
 
     res = xmlSchemaParseNewDocWithContext(newpctxt, schema, bucket);
-    
+
     /* Channel back errors and cleanup the temporary parser context. */
     if (res != 0)
 	pctxt->err = res;
     pctxt->nberrors += newpctxt->nberrors;
     pctxt->counter = newpctxt->counter;
-    newpctxt->constructor = NULL;    
+    newpctxt->constructor = NULL;
     /* Free the parser context. */
     xmlSchemaFreeParserCtxt(newpctxt);
     return(res);
@@ -10217,11 +10217,11 @@
 static const xmlChar *
 xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
 			  xmlNodePtr ctxtNode)
-{    
+{
     /*
     * Build an absolue location URI.
     */
-    if (location != NULL) {	
+    if (location != NULL) {
 	if (ctxtNode == NULL)
 	    return(location);
 	else {
@@ -10244,7 +10244,7 @@
     }
     return(NULL);
 }
-    
+
 
 
 /**
@@ -10267,8 +10267,8 @@
 		const char *schemaBuffer,
 		int schemaBufferLen,
 		xmlNodePtr invokingNode,
-		const xmlChar *sourceTargetNamespace,		
-		const xmlChar *importNamespace,	
+		const xmlChar *sourceTargetNamespace,
+		const xmlChar *importNamespace,
 		xmlSchemaBucketPtr *bucket)
 {
     const xmlChar *targetNamespace = NULL;
@@ -10279,7 +10279,7 @@
 
     if (bucket != NULL)
 	*bucket = NULL;
-    
+
     switch (type) {
 	case XML_SCHEMA_SCHEMA_IMPORT:
 	case XML_SCHEMA_SCHEMA_MAIN:
@@ -10291,23 +10291,23 @@
 	case XML_SCHEMA_SCHEMA_REDEFINE:
 	    err = XML_SCHEMAP_SRC_REDEFINE;
 	    break;
-    }    
-       
+    }
+
 
     /* Special handling for the main schema:
     * skip the location and relation logic and just parse the doc.
     * We need just a bucket to be returned in this case.
-    */    
+    */
     if ((type == XML_SCHEMA_SCHEMA_MAIN) || (! WXS_HAS_BUCKETS(pctxt)))
-	goto doc_load;	
+	goto doc_load;
 
-    /* Note that we expect the location to be an absulute URI. */ 
+    /* Note that we expect the location to be an absulute URI. */
     if (schemaLocation != NULL) {
 	bkt = xmlSchemaGetSchemaBucket(pctxt, schemaLocation);
 	if ((bkt != NULL) &&
 	    (pctxt->constructor->bucket == bkt)) {
 	    /* Report self-imports/inclusions/redefinitions. */
-	    
+
 	    xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
 		invokingNode, NULL,
 		"The schema must not import/include/redefine itself",
@@ -10320,7 +10320,7 @@
     */
     relation = xmlSchemaSchemaRelationCreate();
     if (relation == NULL)
-	return(-1);    
+	return(-1);
     xmlSchemaSchemaRelationAddChild(pctxt->constructor->bucket,
 	relation);
     relation->type = type;
@@ -10329,7 +10329,7 @@
     * Save the namespace import information.
     */
     if (WXS_IS_BUCKET_IMPMAIN(type)) {
-	relation->importNamespace = importNamespace;	
+	relation->importNamespace = importNamespace;
 	if (schemaLocation == NULL) {
 	    /*
 	    * No location; this is just an import of the namespace.
@@ -10342,7 +10342,7 @@
     }
 
     /* Did we already fetch the doc? */
-    if (bkt != NULL) {		
+    if (bkt != NULL) {
 	/* TODO: The following nasty cases will produce an error. */
 	if ((WXS_IS_BUCKET_IMPMAIN(type)) && (! bkt->imported)) {
 	    /* We included/redefined and then try to import a schema. */
@@ -10364,9 +10364,9 @@
 		"redefined, since it was already imported",
 		schemaLocation, NULL);
 	    goto exit;
-	}	
+	}
     }
-    	
+
     if (WXS_IS_BUCKET_IMPMAIN(type)) {
 	/*
 	* Given that the schemaLocation [attribute] is only a hint, it is open
@@ -10387,7 +10387,7 @@
 	* 5 Attempt to resolve the namespace name to locate such a resource.
 	*
 	* NOTE: (3) and (5) are not supported.
-	*/	
+	*/
 	if (bkt != NULL) {
 	    relation->bucket = bkt;
 	    goto exit;
@@ -10395,7 +10395,7 @@
 	bkt = xmlSchemaGetSchemaBucketByTNS(pctxt,
 	    importNamespace, 1);
 
-	if (bkt != NULL) {	    
+	if (bkt != NULL) {
 	    relation->bucket = bkt;
 	    if (bkt->schemaLocation == NULL) {
 		/* First given location of the schema; load the doc. */
@@ -10421,19 +10421,19 @@
 		}
 		goto exit;
 	    }
-	}	
-	/* 
+	}
+	/*
 	* No bucket + first location: load the doc and create a
 	* bucket.
 	*/
     } else {
 	/* <include> and <redefine> */
 	if (bkt != NULL) {
-	    	    
+
 	    if ((bkt->origTargetNamespace == NULL) &&
 		(bkt->targetNamespace != sourceTargetNamespace)) {
 		xmlSchemaBucketPtr chamel;
-		
+
 		/*
 		* Chameleon include/redefine: skip loading only if it was
 		* aleady build for the targetNamespace of the including
@@ -10458,7 +10458,7 @@
 		    relation->bucket = chamel;
 		    goto exit;
 		}
-		/* 
+		/*
 		* We need to parse the chameleon again for a different
 		* targetNamespace.
 		* CHAMELEON TODO: Optimize this by only parsing the
@@ -10469,7 +10469,7 @@
 	    } else {
 		relation->bucket = bkt;
 		goto exit;
-	    }	    
+	    }
 	}
     }
     if ((bkt != NULL) && (bkt->doc != NULL)) {
@@ -10521,7 +10521,7 @@
 		NULL, NULL, SCHEMAS_PARSE_OPTIONS);
 	    schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer");
 	    if (doc != NULL)
-		doc->URL = schemaLocation;	    
+		doc->URL = schemaLocation;
 	}
 	/*
 	* For <import>:
@@ -10575,11 +10575,11 @@
     if (doc != NULL) {
 	xmlNodePtr docElem = NULL;
 
-	located = 1;	
+	located = 1;
 	docElem = xmlDocGetRootElement(doc);
 	if (docElem == NULL) {
 	    xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_NOROOT,
-		invokingNode, NULL, 
+		invokingNode, NULL,
 		"The document '%s' has no document element",
 		schemaLocation, NULL);
 	    goto exit_error;
@@ -10598,14 +10598,14 @@
 		schemaLocation, NULL);
 	    goto exit_error;
 	}
-	/* 
+	/*
 	* Note that we don't apply a type check for the
 	* targetNamespace value here.
 	*/
 	targetNamespace = xmlSchemaGetProp(pctxt, docElem,
 	    "targetNamespace");
     }
-    
+
 /* after_doc_loading: */
     if ((bkt == NULL) && located) {
 	/* Only create a bucket if the schema was located. */
@@ -10632,14 +10632,14 @@
 	if (relation != NULL)
 	    relation->bucket = bkt;
     }
-  
+
 exit:
     /*
     * Return the bucket explicitely; this is needed for the
     * main schema.
     */
     if (bucket != NULL)
-	*bucket = bkt;    
+	*bucket = bkt;
     return (0);
 
 exit_error:
@@ -10655,7 +10655,7 @@
 	xmlFreeDoc(doc);
 	if (bkt != NULL)
 	    bkt->doc = NULL;
-    }    
+    }
     return (-1);
 }
 
@@ -10810,11 +10810,11 @@
 	    "Failed to locate a schema at location '%s'. "
 	    "Skipping the import", schemaLocation, NULL, NULL);
     }
-    
-    if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {	
+
+    if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {
 	ret = xmlSchemaParseNewDoc(pctxt, schema, bucket);
     }
-    
+
     return (ret);
 }
 
@@ -10896,7 +10896,7 @@
 		XML_SCHEMAP_SRC_REDEFINE,
 		NULL, node,
 		"The schema document '%s' cannot redefine itself.",
-		*schemaLocation);	    
+		*schemaLocation);
 	} else {
 	    xmlSchemaPCustomErr(pctxt,
 		XML_SCHEMAP_SRC_INCLUDE,
@@ -10906,7 +10906,7 @@
 	}
 	goto exit_error;
     }
-    
+
     return(0);
 exit_error:
     return(pctxt->err);
@@ -10936,19 +10936,19 @@
     res = xmlSchemaParseIncludeOrRedefineAttrs(pctxt, schema,
 	node, (xmlChar **) (&schemaLocation), type);
     if (res != 0)
-	return(res);    	   
+	return(res);
     /*
     * Load and add the schema document.
     */
     res = xmlSchemaAddSchemaDoc(pctxt, type, schemaLocation, NULL,
 	NULL, 0, node, pctxt->targetNamespace, NULL, &bucket);
     if (res != 0)
-	return(res);    
+	return(res);
     /*
     * If we get no schema bucket back, then this means that the schema
     * document could not be located or was broken XML or was not
     * a schema document.
-    */    
+    */
     if ((bucket == NULL) || (bucket->doc == NULL)) {
 	if (type == XML_SCHEMA_SCHEMA_INCLUDE) {
 	    /*
@@ -10990,8 +10990,8 @@
 	* Check targetNamespace sanity before parsing the new schema.
 	* TODO: Note that we won't check further content if the
 	* targetNamespace was bad.
-	*/    
-	if (bucket->origTargetNamespace != NULL) {	    
+	*/
+	if (bucket->origTargetNamespace != NULL) {
 	    /*
 	    * SPEC src-include (2.1)
 	    * "SII has a targetNamespace [attribute], and its ·actual
@@ -11020,7 +11020,7 @@
 		    pctxt->targetNamespace);
 		goto exit_error;
 	    }
-	} else if (pctxt->targetNamespace != NULL) {	    
+	} else if (pctxt->targetNamespace != NULL) {
 	    /*
 	    * Chameleons: the original target namespace will
 	    * differ from the resulting namespace.
@@ -11038,10 +11038,10 @@
 	    }
 	    bucket->targetNamespace = pctxt->targetNamespace;
 	}
-    }    
+    }
     /*
     * Parse the schema.
-    */   
+    */
     if (bucket && (!bucket->parsed) && (bucket->doc != NULL)) {
 	if (isChameleon) {
 	    /* TODO: Get rid of this flag on the schema itself. */
@@ -11058,8 +11058,8 @@
     /*
     * And now for the children...
     */
-    child = node->children;    
-    if (type == XML_SCHEMA_SCHEMA_REDEFINE) {	
+    child = node->children;
+    if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
 	/*
 	* Parse (simpleType | complexType | group | attributeGroup))*
 	*/
@@ -11082,7 +11082,7 @@
 	    } else if (IS_SCHEMA(child, "complexType")) {
 		xmlSchemaParseComplexType(pctxt, schema, child, 1);
 		/* hasRedefinitions = 1; */
-	    } else if (IS_SCHEMA(child, "group")) {		
+	    } else if (IS_SCHEMA(child, "group")) {
 		/* hasRedefinitions = 1; */
 		xmlSchemaParseModelGroupDefinition(pctxt,
 		    schema, child);
@@ -11102,7 +11102,7 @@
 	    */
 	    child = child->next;
 	}
-    }    
+    }
     if (child != NULL) {
 	res = XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED;
 	if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
@@ -11113,8 +11113,8 @@
 	     xmlSchemaPContentErr(pctxt, res,
 		NULL, node, child, NULL,
 		"(annotation?)");
-	}	
-    }       
+	}
+    }
     return(res);
 
 exit_error:
@@ -11164,7 +11164,7 @@
  *     Redefinition Constraints and Semantics (src-redefine)
  *     (6.1), (6.1.1), (6.1.2)
  *
- *   Schema Component Constraint: 
+ *   Schema Component Constraint:
  *     All Group Limited (cos-all-limited) (2)
  *     TODO: Actually this should go to component-level checks,
  *     but is done here due to performance. Move it to an other layer
@@ -11388,7 +11388,7 @@
 			}
 			ctxt->redef->reference = WXS_BASIC_CAST part;
 			ctxt->redefCounter++;
-		    }		        		   
+		    }
 		}
 	    } else if (IS_SCHEMA(child, "any")) {
 		part = (xmlSchemaTreeItemPtr)
@@ -11425,7 +11425,7 @@
 	WXS_ADD_PENDING(ctxt, item);
     }
     if (withParticle)
-	return ((xmlSchemaTreeItemPtr) particle);	
+	return ((xmlSchemaTreeItemPtr) particle);
     else
 	return ((xmlSchemaTreeItemPtr) item);
 }
@@ -11477,7 +11477,7 @@
     */
     xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
     /*
-    * Attribute 
+    * Attribute
     */
     /*
     * Extract the base type. The "base" attribute is mandatory if inside
@@ -11526,7 +11526,7 @@
 		type->base = NULL;
 		type->baseNs = NULL;
 	    }
-	}		
+	}
     }
     /*
     * And now for the children...
@@ -11593,7 +11593,7 @@
 	/*
 	* Model group reference <group>.
 	*/
-	} else if (IS_SCHEMA(child, "group")) {	    
+	} else if (IS_SCHEMA(child, "group")) {
 	    type->subtypes = (xmlSchemaTypePtr)
 		xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
 	    /*
@@ -11931,13 +11931,13 @@
 	xmlSchemaPContentErr(ctxt,
 	    XML_SCHEMAP_S4S_ELEM_MISSING,
 	    NULL, node, NULL, NULL,
-	    "(annotation?, (restriction | extension))");	
+	    "(annotation?, (restriction | extension))");
     }
     if (child == NULL) {
 	xmlSchemaPContentErr(ctxt,
 	    XML_SCHEMAP_S4S_ELEM_MISSING,
 	    NULL, node, NULL, NULL,
-	    "(annotation?, (restriction | extension))");	
+	    "(annotation?, (restriction | extension))");
     }
     if (IS_SCHEMA(child, "restriction")) {
         xmlSchemaParseRestriction(ctxt, schema, child,
@@ -12094,7 +12094,7 @@
 	} else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
 	    xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) {
 	    return (NULL);
-	}	
+	}
     }
 
     if (topLevel == 0) {
@@ -12183,7 +12183,7 @@
 			    NULL, (xmlNodePtr) attr, NULL,
 			    "(#all | List of (extension | restriction))",
 			    attrValue, NULL, NULL, NULL);
-		    } else 
+		    } else
 			final = 1;
 		} else if (xmlStrEqual(attr->name, BAD_CAST "block")) {
 		    /*
@@ -12201,7 +12201,7 @@
 			    NULL, (xmlNodePtr) attr, NULL,
 			    "(#all | List of (extension | restriction)) ",
 			    attrValue, NULL, NULL, NULL);
-		    } else 
+		    } else
 			block = 1;
 		} else {
 			xmlSchemaPIllegalAttrErr(ctxt,
@@ -12212,7 +12212,7 @@
 		    XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
 	    }
 	} else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
-	    xmlSchemaPIllegalAttrErr(ctxt, 
+	    xmlSchemaPIllegalAttrErr(ctxt,
 		XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
 	}
 	attr = attr->next;
@@ -12448,7 +12448,7 @@
 	return(NULL);
     ret->buffer = buffer;
     ret->size = size;
-    ret->dict = xmlDictCreate();    
+    ret->dict = xmlDictCreate();
     return (ret);
 }
 
@@ -12491,7 +12491,7 @@
     if (ctxt == NULL)
         return;
     if (ctxt->doc != NULL && !ctxt->preserve)
-        xmlFreeDoc(ctxt->doc);    
+        xmlFreeDoc(ctxt->doc);
     if (ctxt->vctxt != NULL) {
 	xmlSchemaFreeValidCtxt(ctxt->vctxt);
     }
@@ -12573,7 +12573,7 @@
 	    *  was incorrectly used instead of xmlAutomataNewTransition2()
 	    *  (seems like a copy&paste bug from the XML_SCHEMA_TYPE_ALL
 	    *  section in xmlSchemaBuildAContentModel() ).
-	    * TODO: Check if xmlAutomataNewOnceTrans2() was instead 
+	    * TODO: Check if xmlAutomataNewOnceTrans2() was instead
 	    *  intended for the above "counter" section originally. I.e.,
 	    *  check xs:all with subst-groups.
 	    *
@@ -12582,7 +12582,7 @@
 	    *		       1, 1, member);
 	    */
 	    tmp = xmlAutomataNewTransition2(pctxt->am, start, NULL,
-		member->name, member->targetNamespace, member);	    
+		member->name, member->targetNamespace, member);
 	    xmlAutomataNewEpsilon(pctxt->am, tmp, end);
 	}
     } else {
@@ -12645,11 +12645,11 @@
 	} else if ((particle->maxOccurs >= UNBOUNDED) &&
 	           (particle->minOccurs < 2)) {
 	    /* Special case. */
-	    start = ctxt->state;	    
+	    start = ctxt->state;
 	    ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
-		elemDecl->name, elemDecl->targetNamespace, elemDecl);	    
+		elemDecl->name, elemDecl->targetNamespace, elemDecl);
 	    ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state,
-		elemDecl->name, elemDecl->targetNamespace, elemDecl);	    
+		elemDecl->name, elemDecl->targetNamespace, elemDecl);
 	} else {
 	    int counter;
 	    int maxOccurs = particle->maxOccurs == UNBOUNDED ?
@@ -12684,7 +12684,7 @@
 			    xmlSchemaParticlePtr particle)
 {
     if (particle == NULL) {
-	PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");	    
+	PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
 	return;
     }
     if (particle->children == NULL) {
@@ -13937,7 +13937,7 @@
     if (val != 0)
 	*val = NULL;
 
-    if (attruse->defValue != NULL) {	    
+    if (attruse->defValue != NULL) {
 	*value = attruse->defValue;
 	if (val != NULL)
 	    *val = attruse->defVal;
@@ -14017,12 +14017,12 @@
 				       xmlSchemaItemListPtr baseUses,
 				       xmlSchemaWildcardPtr wild,
 				       xmlSchemaWildcardPtr baseWild)
-{        
+{
     xmlSchemaAttributeUsePtr cur = NULL, bcur;
     int i, j, found; /* err = 0; */
     const xmlChar *bEffValue;
     int effFixed;
-    
+
     if (uses != NULL) {
 	for (i = 0; i < uses->nbItems; i++) {
 	    cur = uses->items[i];
@@ -14030,7 +14030,7 @@
 	    if (baseUses == NULL)
 		goto not_found;
 	    for (j = 0; j < baseUses->nbItems; j++) {
-		bcur = baseUses->items[j];	
+		bcur = baseUses->items[j];
 		if ((WXS_ATTRUSE_DECL_NAME(cur) ==
 			WXS_ATTRUSE_DECL_NAME(bcur)) &&
 		    (WXS_ATTRUSE_DECL_TNS(cur) ==
@@ -14043,7 +14043,7 @@
 		    * namespace}, then  all of the following must be true:"
 		    */
 		    found = 1;
-		    
+
 		    if ((cur->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
 			(bcur->occurs == XML_SCHEMAS_ATTR_USE_REQUIRED))
 		    {
@@ -14069,7 +14069,7 @@
 			WXS_ATTRUSE_TYPEDEF(bcur), 0) != 0)
 		    {
 			xmlChar *strA = NULL, *strB = NULL, *strC = NULL;
-			
+
 			/*
 			* SPEC (2.1.2) "R's {attribute declaration}'s
 			* {type definition} must be validly derived from
@@ -14112,7 +14112,7 @@
 			if ((bEffValue != NULL) &&
 			    (effFixed == 1)) {
 			    const xmlChar *rEffValue = NULL;
-			    
+
 			    xmlSchemaGetEffectiveValueConstraint(bcur,
 				&effFixed, &rEffValue, NULL);
 			    /*
@@ -14126,7 +14126,7 @@
 				(! WXS_ARE_DEFAULT_STR_EQUAL(rEffValue, bEffValue)))
 			    {
 				xmlChar *str = NULL;
-				
+
 				xmlSchemaPAttrUseErr4(pctxt,
 				    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3,
 				    WXS_ITEM_NODE(item), item, cur,
@@ -14145,7 +14145,7 @@
 		    break;
 		}
 	    }
-not_found:	
+not_found:
 	    if (!found) {
 		/*
 		* (2.2) "otherwise the {base type definition} must have an
@@ -14159,7 +14159,7 @@
 		    (WXS_ATTRUSE_DECL(cur))->targetNamespace) != 0))
 		{
 		    xmlChar *str = NULL;
-		    
+
 		    xmlSchemaPAttrUseErr4(pctxt,
 			XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2,
 			WXS_ITEM_NODE(item), item, cur,
@@ -14175,7 +14175,7 @@
 	}
     }
     /*
-    * SPEC derivation-ok-restriction (3):    
+    * SPEC derivation-ok-restriction (3):
     * (3) "For each attribute use in the {attribute uses} of the {base type
     * definition} whose {required} is true, there must be an attribute
     * use with an {attribute declaration} with the same {name} and
@@ -14190,7 +14190,7 @@
 	    found = 0;
 	    if (uses != NULL) {
 		for (i = 0; i < uses->nbItems; i++) {
-		    cur = uses->items[i];	
+		    cur = uses->items[i];
 		    if ((WXS_ATTRUSE_DECL_NAME(cur) ==
 			WXS_ATTRUSE_DECL_NAME(bcur)) &&
 			(WXS_ATTRUSE_DECL_TNS(cur) ==
@@ -14202,7 +14202,7 @@
 	    }
 	    if (!found) {
 		xmlChar *strA = NULL, *strB = NULL;
-		
+
 		xmlSchemaCustomErr4(ACTXT_CAST pctxt,
 		    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3,
 		    NULL, item,
@@ -14224,19 +14224,19 @@
 	/*
 	* (4) "If there is an {attribute wildcard}, all of the
 	* following must be true:"
-	*/   
+	*/
 	if (baseWild == NULL) {
 	    xmlChar *str = NULL;
 
 	    /*
 	    * (4.1) "The {base type definition} must also have one."
-	    */	    
+	    */
 	    xmlSchemaCustomErr4(ACTXT_CAST pctxt,
 		XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1,
 		NULL, item,
 		"The %s has an attribute wildcard, "
 		"but the %s %s '%s' does not have one",
-		WXS_ITEM_TYPE_NAME(item),		    
+		WXS_ITEM_TYPE_NAME(item),
 		WXS_ACTION_STR(action),
 		WXS_ITEM_TYPE_NAME(baseItem),
 		xmlSchemaGetComponentQName(&str, baseItem));
@@ -14316,7 +14316,7 @@
 				  xmlSchemaTypePtr type)
 {
     xmlSchemaTypePtr baseType = NULL;
-    xmlSchemaAttributeUsePtr use;    
+    xmlSchemaAttributeUsePtr use;
     xmlSchemaItemListPtr uses, baseUses, prohibs = NULL;
 
     if (type->baseType == NULL) {
@@ -14324,7 +14324,7 @@
 	    "no base type");
         return (-1);
     }
-    baseType = type->baseType;        
+    baseType = type->baseType;
     if (WXS_IS_TYPE_NOT_FIXED(baseType))
 	if (xmlSchemaTypeFixup(baseType, ACTXT_CAST pctxt) == -1)
 	    return(-1);
@@ -14336,7 +14336,7 @@
     * wildcard, i.e. intersect multiple wildcards.
     * Move attribute prohibitions into a separate list.
     */
-    if (uses != NULL) {	
+    if (uses != NULL) {
 	if (WXS_IS_RESTRICTION(type)) {
 	    /*
 	    * This one will transfer all attr. prohibitions
@@ -14370,7 +14370,7 @@
 
 	if (WXS_IS_RESTRICTION(type)) {
 	    int usesCount;
-	    xmlSchemaAttributeUsePtr tmp; 
+	    xmlSchemaAttributeUsePtr tmp;
 
 	    if (uses != NULL)
 		usesCount = uses->nbItems;
@@ -14420,15 +14420,15 @@
 	    }
 	} else {
 	    /* Extension. */
-	    for (i = 0; i < baseUses->nbItems; i++) {	    
-		use = baseUses->items[i];		
+	    for (i = 0; i < baseUses->nbItems; i++) {
+		use = baseUses->items[i];
 		if (uses == NULL) {
 		    type->attrUses = xmlSchemaItemListCreate();
 		    if (type->attrUses == NULL)
 			goto exit_failure;
 		    uses = type->attrUses;
 		}
-		xmlSchemaItemListAddSize(uses, baseUses->nbItems, use); 
+		xmlSchemaItemListAddSize(uses, baseUses->nbItems, use);
 	    }
 	}
     }
@@ -14448,7 +14448,7 @@
     /*
     * Compute the complete wildcard.
     */
-    if (WXS_IS_EXTENSION(type)) {	
+    if (WXS_IS_EXTENSION(type)) {
 	if (baseType->attributeWildcard != NULL) {
 	    /*
 	    * (3.2.2.1) "If the ·base wildcard· is non-·absent·, then
@@ -14467,14 +14467,14 @@
 		*/
 		if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard,
 		    baseType->attributeWildcard) == -1)
-		    goto exit_failure;		
+		    goto exit_failure;
 	    } else {
 		/*
 		* (3.2.2.1.1) "If the ·complete wildcard· is ·absent·,
 		* then the ·base wildcard·."
 		*/
 		type->attributeWildcard = baseType->attributeWildcard;
-	    }	 
+	    }
 	} else {
 	    /*
 	    * (3.2.2.2) "otherwise (the ·base wildcard· is ·absent·) the
@@ -14490,7 +14490,7 @@
 	* NOOP
 	*/
     }
-    
+
     return (0);
 
 exit_failure:
@@ -14865,10 +14865,10 @@
 xmlSchemaCheckUnionTypeDefCircularRecur(xmlSchemaParserCtxtPtr pctxt,
 					xmlSchemaTypePtr ctxType,
 					xmlSchemaTypeLinkPtr members)
-{    
+{
     xmlSchemaTypeLinkPtr member;
     xmlSchemaTypePtr memberType;
-    
+
     member = members;
     while (member != NULL) {
 	memberType = member->type;
@@ -14969,7 +14969,7 @@
 	    }
 	    return;
 	}
-    } 
+    }
     /*
     * The ball of letters below means, that if we have a particle
     * which has a QName-helper component as its {term}, we want
@@ -15012,7 +15012,7 @@
 	    * particle's {term}.
 	    */
 	    WXS_TYPE_PARTICLE_TERM(typeDef) = WXS_MODELGROUPDEF_MODEL(groupDef);
-	    
+
 	    if (WXS_MODELGROUPDEF_MODEL(groupDef)->type == XML_SCHEMA_TYPE_ALL) {
 		/*
 		* SPEC cos-all-limited (1.2)
@@ -15609,7 +15609,7 @@
  * @ctxt:  the schema parser context
  * @type:  the simple type definition
  *
- * Checks crc-simple-type constraints. 
+ * Checks crc-simple-type constraints.
  *
  * Returns 0 if the constraints are satisfied,
  * if not a positive error code and -1 on internal
@@ -15624,7 +15624,7 @@
     * src-simple-type.1 The corresponding simple type definition, if any,
     * must satisfy the conditions set out in Constraints on Simple Type
     * Definition Schema Components (§3.14.6).
-    */    
+    */
     if (WXS_IS_RESTRICTION(type)) {
 	/*
 	* src-simple-type.2 "If the <restriction> alternative is chosen,
@@ -15633,7 +15633,7 @@
 	* NOTE: This is checked in the parse function of <restriction>.
 	*/
 	/*
-	* 
+	*
 	*/
     } else if (WXS_IS_LIST(type)) {
 	/* src-simple-type.3 "If the <list> alternative is chosen, either it must have
@@ -15642,8 +15642,8 @@
 	*
 	* NOTE: This is checked in the parse function of <list>.
 	*/
-    } else if (WXS_IS_UNION(type)) {	
-	/* 
+    } else if (WXS_IS_UNION(type)) {
+	/*
 	* src-simple-type.4 is checked in xmlSchemaCheckUnionTypeDefCircular().
 	*/
     }
@@ -15798,7 +15798,7 @@
 	*/
 	xmlSchemaCustomErr(ACTXT_CAST pctxt,
 	    XML_SCHEMAP_SRC_CT_1,
-	    NULL, WXS_BASIC_CAST type, 
+	    NULL, WXS_BASIC_CAST type,
 	    "If the base type is a simple type, the derivation method must be "
 	    "'extension'", NULL, NULL);
 	return (XML_SCHEMAP_SRC_CT_1);
@@ -15815,7 +15815,7 @@
     *   - attribute uses need to be already inherited (apply attr. prohibitions)
     *   - attribute group references need to be expanded already
     *   - simple types need to be typefixed already
-    */    
+    */
     if (type->attrUses &&
 	(((xmlSchemaItemListPtr) type->attrUses)->nbItems > 1))
     {
@@ -15825,8 +15825,8 @@
 
 	for (i = uses->nbItems -1; i >= 0; i--) {
 	    use = uses->items[i];
-	    
-	    /* 
+
+	    /*
 	    * SPEC ct-props-correct
 	    * (4) "Two distinct attribute declarations in the
 	    * {attribute uses} must not have identical {name}s and
@@ -15867,10 +15867,10 @@
 	    if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
 		if (xmlSchemaIsDerivedFromBuiltInType(
 		    WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
-		{		
+		{
 		    if (hasId) {
 			xmlChar *str = NULL;
-			
+
 			xmlSchemaCustomErr(ACTXT_CAST pctxt,
 			    XML_SCHEMAP_AG_PROPS_CORRECT,
 			    NULL, WXS_BASIC_CAST type,
@@ -15884,7 +15884,7 @@
 			if (xmlSchemaItemListRemove(uses, i) == -1)
 			    goto exit_failure;
 		    }
-		    
+
 		    hasId = 1;
 		}
 	    }
@@ -16037,7 +16037,7 @@
     * SPEC (1) "If the {base type definition} is a complex type definition,
     * then all of the following must be true:"
     */
-    if (WXS_IS_COMPLEX(base)) {	
+    if (WXS_IS_COMPLEX(base)) {
 	/*
 	* SPEC (1.1) "The {final} of the {base type definition} must not
 	* contain extension."
@@ -16050,7 +16050,7 @@
 		"contains 'extension'", NULL);
 	    return (XML_SCHEMAP_COS_CT_EXTENDS_1_1);
 	}
-	
+
 	/*
 	* ATTENTION: The constrains (1.2) and (1.3) are not applied,
 	* since they are automatically satisfied through the
@@ -16094,11 +16094,11 @@
 		}
 		if (! found) {
 		    xmlChar *str = NULL;
-		
+
 		    xmlSchemaCustomErr(ACTXT_CAST ctxt,
 			XML_SCHEMAP_COS_CT_EXTENDS_1_2,
 			NULL, WXS_BASIC_CAST type,
-			/* 
+			/*
 			* TODO: The report does not indicate that also the
 			* type needs to be the same.
 			*/
@@ -16118,7 +16118,7 @@
 	* of the complex  type definition's {attribute wildcard}'s {namespace
 	* constraint}, as defined by Wildcard Subset (§3.10.6)."
 	*/
-  
+
 	/*
 	* MAYBE TODO: Enable if ever needed. But this will be needed only
 	* if created the type via a schema construction API.
@@ -16126,7 +16126,7 @@
 	if (base->attributeWildcard != NULL) {
 	    if (type->attributeWilcard == NULL) {
 		xmlChar *str = NULL;
-		
+
 		xmlSchemaCustomErr(ACTXT_CAST pctxt,
 		    XML_SCHEMAP_COS_CT_EXTENDS_1_3,
 		    NULL, type,
@@ -16139,7 +16139,7 @@
 		base->attributeWildcard, type->attributeWildcard))
 	    {
 		xmlChar *str = NULL;
-		
+
 		xmlSchemaCustomErr(ACTXT_CAST pctxt,
 		    XML_SCHEMAP_COS_CT_EXTENDS_1_3,
 		    NULL, type,
@@ -16293,7 +16293,7 @@
     */
     base = type->baseType;
     if (! WXS_IS_COMPLEX(base)) {
-	xmlSchemaCustomErr(ACTXT_CAST ctxt,	    
+	xmlSchemaCustomErr(ACTXT_CAST ctxt,
 	    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
 	    type->node, WXS_BASIC_CAST type,
 	    "The base type must be a complex type", NULL, NULL);
@@ -16304,7 +16304,7 @@
 	* SPEC (1) "The {base type definition} must be a complex type
 	* definition whose {final} does not contain restriction."
 	*/
-	xmlSchemaCustomErr(ACTXT_CAST ctxt,	    
+	xmlSchemaCustomErr(ACTXT_CAST ctxt,
 	    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
 	    type->node, WXS_BASIC_CAST type,
 	    "The 'final' of the base type definition "
@@ -16355,7 +16355,7 @@
 	    *
 	    * ATTENTION TODO: This seems not needed if the type implicitely
 	    * derived from the base type.
-	    * 
+	    *
 	    */
 	    err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt,
 		type->contentTypeDef, base->contentTypeDef, 0);
@@ -16429,7 +16429,7 @@
 	/*
 	* SPEC (5.4.1.1) "The {content type} of the complex type definition
 	* itself must be element-only"
-	*/	 
+	*/
 	if (WXS_HAS_MIXED_CONTENT(type) && (! WXS_HAS_MIXED_CONTENT(base))) {
 	    /*
 	    * SPEC (5.4.1.2) "The {content type} of the complex type
@@ -16586,11 +16586,11 @@
 		if (! xmlSchemaIsParticleEmptiable(
 		    (xmlSchemaParticlePtr) base->subtypes)) {
 		    ret = XML_SCHEMAP_SRC_CT_1;
-		} else 
+		} else
 		    /*
 		    * Attention: at this point the <simpleType> child is in
 		    * ->contentTypeDef (put there during parsing).
-		    */		    
+		    */
 		    if (type->contentTypeDef == NULL) {
 		    xmlChar *str = NULL;
 		    /*
@@ -17131,7 +17131,7 @@
 
     /*
     * SPEC st-restrict-facets 1:
-    * "The {variety} of R is the same as that of B."    
+    * "The {variety} of R is the same as that of B."
     */
     /*
     * SPEC st-restrict-facets 2:
@@ -17704,7 +17704,7 @@
 
 static void
 xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
-{       
+{
     int has = 0, needVal = 0, normVal = 0;
 
     has	= (type->baseType->flags & XML_SCHEMAS_TYPE_HAS_FACETS) ? 1 : 0;
@@ -17716,7 +17716,7 @@
     }
     if (type->facets != NULL) {
 	xmlSchemaFacetPtr fac;
-	
+
 	for (fac = type->facets; fac != NULL; fac = fac->next) {
 	    switch (fac->type) {
 		case XML_SCHEMA_FACET_WHITESPACE:
@@ -17734,7 +17734,7 @@
 		    has = 1;
 		    break;
 	    }
-	}	
+	}
     }
     if (normVal)
 	type->flags |= XML_SCHEMAS_TYPE_NORMVALUENEEDED;
@@ -17751,24 +17751,24 @@
 	if ((prim->builtInType != XML_SCHEMAS_ANYSIMPLETYPE) &&
 	    (prim->builtInType != XML_SCHEMAS_STRING)) {
 	    type->flags |= XML_SCHEMAS_TYPE_FACETSNEEDVALUE;
-	} 	
-    }       
+	}
+    }
 }
 
 static int
 xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
 {
-    
-    
+
+
     /*
     * Evaluate the whitespace-facet value.
-    */    
+    */
     if (WXS_IS_LIST(type)) {
 	type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE;
 	return (0);
     } else if (WXS_IS_UNION(type))
 	return (0);
-    
+
     if (type->facetSet != NULL) {
 	xmlSchemaFacetLinkPtr lin;
 
@@ -17792,23 +17792,23 @@
 	}
     }
     /*
-    * For all ·atomic· datatypes other than string (and types ·derived· 
-    * by ·restriction· from it) the value of whiteSpace is fixed to 
+    * For all ·atomic· datatypes other than string (and types ·derived·
+    * by ·restriction· from it) the value of whiteSpace is fixed to
     * collapse
     */
     {
 	xmlSchemaTypePtr anc;
 
-	for (anc = type->baseType; anc != NULL && 
+	for (anc = type->baseType; anc != NULL &&
 		anc->builtInType != XML_SCHEMAS_ANYTYPE;
 		anc = anc->baseType) {
 
 	    if (anc->type == XML_SCHEMA_TYPE_BASIC) {
-		if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {	    
+		if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {
 		    type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_REPLACE;
 
 		} else if ((anc->builtInType == XML_SCHEMAS_STRING) ||
-		    (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {		    
+		    (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {
 		    type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE;
 
 		} else
@@ -17845,7 +17845,7 @@
     } else if (WXS_IS_UNION(type)) {
 	/*
 	* Corresponds to <simpleType><union>...
-	*/	
+	*/
 	if (type->memberTypes == NULL) {
 	    /*
 	    * This one is really needed, so get out.
@@ -17853,8 +17853,8 @@
 	    PERROR_INT("xmlSchemaFixupSimpleTypeStageOne",
 		"union type has no member-types assigned");
 	    return(-1);
-	}	    
-    } else {    
+	}
+    } else {
 	/*
 	* Corresponds to <simpleType><restriction>...
 	*/
@@ -17969,7 +17969,7 @@
     }
     if (WXS_IS_TYPE_NOT_FIXED(type->baseType))
 	xmlSchemaTypeFixup(type->baseType, ACTXT_CAST pctxt);
-    /* 
+    /*
     * If a member type of a union is a union itself, we need to substitute
     * that member type for its member types.
     * NOTE that this might change in WXS 1.1; i.e. we will keep the union
@@ -17977,9 +17977,9 @@
     */
     if ((type->memberTypes != NULL) &&
 	(xmlSchemaFinishMemberTypeDefinitionsProperty(pctxt, type) == -1))
-	return(-1);        
+	return(-1);
     /*
-    * SPEC src-simple-type 1 
+    * SPEC src-simple-type 1
     * "The corresponding simple type definition, if any, must satisfy
     * the conditions set out in Constraints on Simple Type Definition
     * Schema Components (§3.14.6)."
@@ -17990,7 +17990,7 @@
     */
     res = xmlSchemaCheckSTPropsCorrect(pctxt, type);
     HFAILURE HERROR
-    /* 
+    /*
     * Schema Component Constraint: Derivation Valid (Restriction, Simple)
     * (cos-st-restricts)
     */
@@ -18023,7 +18023,7 @@
     */
     res = xmlSchemaTypeFixupWhitespace(type);
     HFAILURE HERROR
-    xmlSchemaTypeFixupOptimFacets(type);    
+    xmlSchemaTypeFixupOptimFacets(type);
 
 exit_error:
 #ifdef DEBUG_TYPE
@@ -18054,7 +18054,7 @@
 	PERROR_INT("xmlSchemaFixupComplexType",
 	    "missing baseType");
 	goto exit_failure;
-    }    
+    }
     /*
     * Fixup the base type.
     */
@@ -18066,12 +18066,12 @@
 	* TODO: Generate a warning!
 	*/
 	return(0);
-    }	
+    }
     /*
     * This basically checks if the base type can be derived.
     */
     res = xmlSchemaCheckSRCCT(pctxt, type);
-    HFAILURE HERROR   
+    HFAILURE HERROR
     /*
     * Fixup the content type.
     */
@@ -18145,7 +18145,7 @@
 	    type->facets = NULL;
 	    content->facetSet = type->facetSet;
 	    type->facetSet = NULL;
-	    
+
 	    type->contentTypeDef = content;
 	    if (WXS_IS_TYPE_NOT_FIXED(contentBase))
 		xmlSchemaTypeFixup(contentBase, ACTXT_CAST pctxt);
@@ -18154,10 +18154,10 @@
 	    * for circularity here.
 	    */
 	    res = xmlSchemaFixupSimpleTypeStageOne(pctxt, content);
-	    HFAILURE HERROR 
+	    HFAILURE HERROR
 	    res = xmlSchemaFixupSimpleTypeStageTwo(pctxt, content);
-	    HFAILURE HERROR 
-		
+	    HFAILURE HERROR
+
 	} else if ((WXS_IS_COMPLEX(baseType)) &&
 	    (baseType->contentType == XML_SCHEMA_CONTENT_MIXED) &&
 	    (WXS_IS_RESTRICTION(type))) {
@@ -18267,7 +18267,7 @@
 			XML_SCHEMA_TYPE_SEQUENCE, type->node);
 		    if (particle->children == NULL)
 			goto exit_failure;
-		    
+
 		    type->subtypes = (xmlSchemaTypePtr) particle;
 		}
 		dummySequence = 1;
@@ -18580,11 +18580,11 @@
 		    }
 		} else
 		    base = typeDecl;
-	                 
+
 		if (! ctxtGiven) {
 		    /*
 		    * A context is needed if called from RelaxNG.
-		    */		    
+		    */
 		    pctxt = xmlSchemaNewParserCtxt("*");
 		    if (pctxt == NULL)
 			return (-1);
@@ -18595,17 +18595,17 @@
 		* facet->node is just the node holding the facet
 		* definition, *not* the attribute holding the *value*
 		* of the facet.
-		*/		
+		*/
 		ret = xmlSchemaVCheckCVCSimpleType(
 		    ACTXT_CAST pctxt, facet->node, base,
 		    facet->value, &(facet->val), 1, 1, 0);
                 if (ret != 0) {
 		    if (ret < 0) {
 			/* No error message for RelaxNG. */
-			if (ctxtGiven) {			    
+			if (ctxtGiven) {
 			    xmlSchemaCustomErr(ACTXT_CAST pctxt,
 				XML_SCHEMAP_INTERNAL, facet->node, NULL,
-				"Internal error: xmlSchemaCheckFacet, " 
+				"Internal error: xmlSchemaCheckFacet, "
 				"failed to validate the value '%s' of the "
 				"facet '%s' against the base type",
 				facet->value, xmlSchemaFacetTypeToString(facet->type));
@@ -18680,17 +18680,17 @@
 		    /* error code */
 		    xmlSchemaCustomErr4(ACTXT_CAST pctxt,
 			ret, facet->node, WXS_BASIC_CAST typeDecl,
-			"The value '%s' of the facet '%s' is not a valid '%s'",			
+			"The value '%s' of the facet '%s' is not a valid '%s'",
 			facet->value,
 			xmlSchemaFacetTypeToString(facet->type),
-			(facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ? 
+			(facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ?
 			    BAD_CAST "nonNegativeInteger" :
 			    BAD_CAST "positiveInteger",
 			NULL);
 		}
 	    }
 	    break;
-            
+
         case XML_SCHEMA_FACET_WHITESPACE:{
                 if (xmlStrEqual(facet->value, BAD_CAST "preserve")) {
                     facet->whitespace = XML_SCHEMAS_FACET_PRESERVE;
@@ -18903,7 +18903,7 @@
 	{
 	    particle = WXS_PTC_CAST particle->next;
 	    continue;
-	} 
+	}
 	if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
 	    /*
 	    * TODO: Remove the particle.
@@ -18953,7 +18953,7 @@
 	    if (gr == ctxtGr)
 		return(ref);
 	    if (gr->flags & XML_SCHEMAS_ATTRGROUP_MARKED)
-		continue;	    
+		continue;
 	    /*
 	    * Mark as visited to avoid infinite recursion on
 	    * circular references not yet examined.
@@ -18963,12 +18963,12 @@
 	    {
 		gr->flags |= XML_SCHEMAS_ATTRGROUP_MARKED;
 		circ = xmlSchemaCheckAttrGroupCircularRecur(ctxtGr,
-		    (xmlSchemaItemListPtr) gr->attrUses);		
+		    (xmlSchemaItemListPtr) gr->attrUses);
 		gr->flags ^= XML_SCHEMAS_ATTRGROUP_MARKED;
 		if (circ != NULL)
 		    return (circ);
 	    }
-	    
+
 	}
     }
     return (NULL);
@@ -19006,9 +19006,9 @@
 	return(0);
     else {
 	xmlSchemaQNameRefPtr circ;
-	
+
 	circ = xmlSchemaCheckAttrGroupCircularRecur(attrGr,
-	    (xmlSchemaItemListPtr) attrGr->attrUses);	
+	    (xmlSchemaItemListPtr) attrGr->attrUses);
 	if (circ != NULL) {
 	    xmlChar *str = NULL;
 	    /*
@@ -19040,7 +19040,7 @@
  * xmlSchemaExpandAttributeGroupRefs:
  * @pctxt: the parser context
  * @node: the node of the component holding the attribute uses
- * @completeWild: the intersected wildcard to be returned 
+ * @completeWild: the intersected wildcard to be returned
  * @list: the attribute uses
  *
  * Substitutes contained attribute group references
@@ -19069,7 +19069,7 @@
     for (i = 0; i < list->nbItems; i++) {
 	use = list->items[i];
 
-	if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {	    
+	if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
 	    if (prohibs == NULL) {
 		PERROR_INT("xmlSchemaExpandAttributeGroupRefs",
 		    "unexpected attr prohibition found");
@@ -19084,7 +19084,7 @@
 	    /*
 	    * Note that duplicate prohibitions were already
 	    * handled at parsing time.
-	    */	    
+	    */
 	    /*
 	    * Add to list of prohibitions.
 	    */
@@ -19137,7 +19137,7 @@
 			*completeWild = tmpWild;
 			created = 1;
 		    }
-		    
+
 		    if (xmlSchemaIntersectWildcards(pctxt, *completeWild,
 			gr->attributeWildcard) == -1)
 			return(-1);
@@ -19211,7 +19211,7 @@
 /**
  * xmlSchemaAttributeGroupExpandRefs:
  * @pctxt:  the parser context
- * @attrGr:  the attribute group definition 
+ * @attrGr:  the attribute group definition
  *
  * Computation of:
  * {attribute uses} property
@@ -19223,7 +19223,7 @@
 static int
 xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
 				  xmlSchemaAttributeGroupPtr attrGr)
-{  
+{
     if ((attrGr->attrUses == NULL) ||
 	(attrGr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED))
 	return(0);
@@ -19231,25 +19231,25 @@
     attrGr->flags |= XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED;
     if (xmlSchemaExpandAttributeGroupRefs(pctxt, WXS_BASIC_CAST attrGr,
 	&(attrGr->attributeWildcard), attrGr->attrUses, NULL) == -1)
-	return(-1);    
+	return(-1);
     return(0);
 }
 
 /**
  * xmlSchemaAttributeGroupExpandRefs:
  * @pctxt:  the parser context
- * @attrGr:  the attribute group definition 
+ * @attrGr:  the attribute group definition
  *
  * Substitutes contained attribute group references
  * for their attribute uses. Wilcards are intersected.
- * 
+ *
  * Schema Component Constraint:
- *    Attribute Group Definition Properties Correct (ag-props-correct) 
+ *    Attribute Group Definition Properties Correct (ag-props-correct)
  */
 static int
 xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
 				  xmlSchemaAttributeGroupPtr attrGr)
-{  
+{
     /*
     * SPEC ag-props-correct
     * (1) "The values of the properties of an attribute group definition
@@ -19257,7 +19257,7 @@
     * Group Definition Schema Component (§3.6.1), modulo the impact of
     * Missing Sub-components (§5.3);"
     */
-    
+
     if ((attrGr->attrUses != NULL) &&
 	(WXS_LIST_CAST attrGr->attrUses)->nbItems > 1)
     {
@@ -19266,7 +19266,7 @@
 	int i, j, hasId = 0;
 
 	for (i = uses->nbItems -1; i >= 0; i--) {
-	    use = uses->items[i];	    
+	    use = uses->items[i];
 	    /*
 	    * SPEC ag-props-correct
 	    * (2) "Two distinct members of the {attribute uses} must not have
@@ -19282,7 +19282,7 @@
 			WXS_ATTRUSE_DECL_TNS(tmp)))
 		    {
 			xmlChar *str = NULL;
-			
+
 			xmlSchemaCustomErr(ACTXT_CAST pctxt,
 			    XML_SCHEMAP_AG_PROPS_CORRECT,
 			    attrGr->node, WXS_BASIC_CAST attrGr,
@@ -19306,13 +19306,13 @@
 	    * are derived from ID."
 	    * TODO: Does 'derived' include member-types of unions?
 	    */
-	    if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {		
+	    if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
 		if (xmlSchemaIsDerivedFromBuiltInType(
 		    WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
-		{		
+		{
 		    if (hasId) {
 			xmlChar *str = NULL;
-			
+
 			xmlSchemaCustomErr(ACTXT_CAST pctxt,
 			    XML_SCHEMAP_AG_PROPS_CORRECT,
 			    attrGr->node, WXS_BASIC_CAST attrGr,
@@ -19325,7 +19325,7 @@
 			FREE_AND_NULL(str);
 			if (xmlSchemaItemListRemove(uses, i) == -1)
 			    return(-1);
-		    }		    
+		    }
 		    hasId = 1;
 		}
 	    }
@@ -19392,7 +19392,7 @@
     * Declaration Schema Component (§3.2.1), modulo the impact of
     * Missing Sub-components (§5.3)."
     */
-    
+
     if (WXS_ATTR_TYPEDEF(attr) == NULL)
 	return(0);
 
@@ -19441,7 +19441,7 @@
 	    return(pctxt->err);
 	}
     }
-   
+
     return(0);
 }
 
@@ -19767,12 +19767,12 @@
  * @ctxtParticle: the first particle of the context component
  * @searchParticle: the element declaration particle to be analysed
  *
- * Schema Component Constraint: Element Declarations Consistent 
+ * Schema Component Constraint: Element Declarations Consistent
  */
 static int
 xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
 				    xmlSchemaBasicItemPtr ctxtComponent,
-				    xmlSchemaParticlePtr ctxtParticle,				    
+				    xmlSchemaParticlePtr ctxtParticle,
 				    xmlSchemaParticlePtr searchParticle,
 				    xmlSchemaParticlePtr curParticle,
 				    int search)
@@ -19781,7 +19781,7 @@
 
     int ret = 0;
     xmlSchemaParticlePtr cur = curParticle;
-    if (curParticle == NULL) {	
+    if (curParticle == NULL) {
 	return(0);
     }
     if (WXS_PARTICLE_TERM(curParticle) == NULL) {
@@ -19790,7 +19790,7 @@
 	* might arise due to an invalid "term" component.
 	*/
 	return(0);
-    }    
+    }
     while (cur != NULL) {
 	switch (WXS_PARTICLE_TERM(cur)->type) {
 	    case XML_SCHEMA_TYPE_ANY:
@@ -19800,7 +19800,7 @@
 		    ret = xmlSchemaCheckElementDeclConsistent(pctxt,
 			ctxtComponent, ctxtParticle, cur, ctxtParticle, 1);
 		    if (ret != 0)
-			return(ret);		    
+			return(ret);
 		} else {
 		    xmlSchemaElementPtr elem =
 			WXS_ELEM_CAST(WXS_PARTICLE_TERM(cur));
@@ -19820,7 +19820,7 @@
 			    WXS_PARTICLE_TERM_AS_ELEM(searchParticle)->targetNamespace))
 		    {
 			xmlChar *strA = NULL, *strB = NULL;
-			
+
 			xmlSchemaCustomErr(ACTXT_CAST pctxt,
 			    /* TODO: error code */
 			    XML_SCHEMAP_COS_NONAMBIG,
@@ -19837,16 +19837,16 @@
 			FREE_AND_NULL(strB);
 			return(XML_SCHEMAP_COS_NONAMBIG);
 		    }
-		}	    
+		}
 		break;
-	    case XML_SCHEMA_TYPE_SEQUENCE: {		
+	    case XML_SCHEMA_TYPE_SEQUENCE: {
 		break;
 		}
 	    case XML_SCHEMA_TYPE_CHOICE:{
 		/*
 		xmlSchemaTreeItemPtr sub;
-		
-		sub = WXS_PARTICLE_TERM(particle)->children;  (xmlSchemaParticlePtr) 
+
+		sub = WXS_PARTICLE_TERM(particle)->children;  (xmlSchemaParticlePtr)
 		while (sub != NULL) {
 		    ret = xmlSchemaCheckElementDeclConsistent(pctxt, ctxtComponent,
 			ctxtParticle, ctxtElem);
@@ -19883,7 +19883,7 @@
  * @name:  the name of the attribute
  *
  * Validates the value constraints of an element declaration.
- * Adds substitution group members. 
+ * Adds substitution group members.
  */
 static void
 xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl,
@@ -19898,7 +19898,7 @@
 	/*
 	* Adds substitution group members.
 	*/
-	xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);	
+	xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
     }
 }
 
@@ -19928,7 +19928,7 @@
 		XML_SCHEMA_EXTRA_QNAMEREF))
 	{
 	    goto next_particle;
-	} 
+	}
 	ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
 	/*
 	* Resolve the reference.
@@ -19944,7 +19944,7 @@
 		ref->targetNamespace, ref->itemType, NULL);
 	    /* TODO: remove the particle. */
 	    goto next_particle;
-	} 
+	}
 	if (refItem->type == XML_SCHEMA_TYPE_GROUP) {
 	    if (WXS_MODELGROUPDEF_MODEL(refItem) == NULL)
 		/* TODO: remove the particle. */
@@ -19994,9 +19994,9 @@
 
 static int
 xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
-		       xmlSchemaValPtr y) 
-{   
-    xmlSchemaTypePtr tx, ty, ptx, pty;    
+		       xmlSchemaValPtr y)
+{
+    xmlSchemaTypePtr tx, ty, ptx, pty;
     int ret;
 
     while (x != NULL) {
@@ -20042,7 +20042,7 @@
 	if (x != NULL) {
 	    y = xmlSchemaValueGetNext(y);
 	    if (y == NULL)
-		return (0);	    
+		return (0);
 	} else if (xmlSchemaValueGetNext(y) != NULL)
 	    return (0);
 	else
@@ -20092,11 +20092,11 @@
 /**
  * xmlSchemaCheckAttrUsePropsCorrect:
  * @ctxt:  a parser context
- * @use:  an attribute use 
+ * @use:  an attribute use
  *
  * Schema Component Constraint:
  * Attribute Use Correct (au-props-correct)
- * 
+ *
  */
 static int
 xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
@@ -20106,7 +20106,7 @@
 	return(-1);
     if ((use->defValue == NULL) || (WXS_ATTRUSE_DECL(use) == NULL) ||
 	((WXS_ATTRUSE_DECL(use))->type != XML_SCHEMA_TYPE_ATTRIBUTE))
-	return(0);	
+	return(0);
 
     /*
     * SPEC au-props-correct (1)
@@ -20115,7 +20115,7 @@
     * Component (§3.5.1), modulo the impact of Missing
     * Sub-components (§5.3)."
     */
-    
+
     if (((WXS_ATTRUSE_DECL(use))->defValue != NULL) &&
 	((WXS_ATTRUSE_DECL(use))->flags & XML_SCHEMAS_ATTR_FIXED) &&
         ((use->flags & XML_SCHEMA_ATTR_USE_FIXED) == 0))
@@ -20135,7 +20135,7 @@
     if ((use->defVal != NULL) && (WXS_ATTRUSE_TYPEDEF(use) != NULL)) {
 	int ret;
 	/*
-	* TODO: The spec seems to be missing a check of the 
+	* TODO: The spec seems to be missing a check of the
 	* value constraint of the attribute use. We will do it here.
 	*/
 	/*
@@ -20152,7 +20152,7 @@
 		NULL, NULL);
 	    return(ctxt->err);
 	}
-	
+
 	ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt,
 	    use->node, WXS_ATTRUSE_TYPEDEF(use),
 	    use->defValue, &(use->defVal),
@@ -20203,7 +20203,7 @@
 /**
  * xmlSchemaResolveAttrTypeReferences:
  * @item:  an attribute declaration
- * @ctxt:  a parser context 
+ * @ctxt:  a parser context
  *
  * Resolves the referenced type definition component.
  */
@@ -20294,7 +20294,7 @@
 		((xmlSchemaIDCPtr) idc->ref->item)->nbFields) {
 		xmlChar *str = NULL;
 		xmlSchemaIDCPtr refer;
-		
+
 		refer = (xmlSchemaIDCPtr) idc->ref->item;
 		/*
 		* SPEC c-props-correct(2)
@@ -20353,7 +20353,7 @@
     int wasRedefined;
 
     if (redef == NULL)
-	return(0);   	
+	return(0);
 
     do {
 	item = redef->item;
@@ -20368,7 +20368,7 @@
 	*   <redefine>d schema. Currenlty we latter approach is used.
 	*   SUPPLEMENT: It seems that the WG moves towards the latter
 	*   approach, so we are doing it right.
-	*   
+	*
 	*/
 	prev = xmlSchemaFindRedefCompInGraph(
 	    redef->targetBucket, item->type,
@@ -20400,7 +20400,7 @@
 		/*
 		* TODO: error code.
 		* Probably XML_SCHEMAP_SRC_RESOLVE, if this is using the
-		* reference kind.		
+		* reference kind.
 		*/
 		XML_SCHEMAP_SRC_REDEFINE, node, NULL,
 		"The %s '%s' to be redefined could not be found in "
@@ -20408,7 +20408,7 @@
 		WXS_ITEM_TYPE_NAME(item),
 		xmlSchemaFormatQName(&str, redef->refTargetNs,
 		    redef->refName));
-	    FREE_AND_NULL(str);	    
+	    FREE_AND_NULL(str);
 	    err = pctxt->err;
 	    redef = redef->next;
 	    continue;
@@ -20434,7 +20434,7 @@
 		* base type of the redefining type.
 		* TODO: How
 		*/
-		((xmlSchemaTypePtr) item)->baseType = 
+		((xmlSchemaTypePtr) item)->baseType =
 		    (xmlSchemaTypePtr) prev;
 		break;
 	    case XML_SCHEMA_TYPE_GROUP:
@@ -20489,7 +20489,7 @@
 	    default:
 		PERROR_INT("xmlSchemaResolveRedefReferences",
 		    "Unexpected redefined component type");
-		return(-1);	
+		return(-1);
 	}
 	if (wasRedefined) {
 	    xmlChar *str = NULL;
@@ -20499,7 +20499,7 @@
 		node = WXS_ITEM_NODE(redef->reference);
 	    else
 		node = WXS_ITEM_NODE(redef->item);
-	    
+
 	    xmlSchemaCustomErr(ACTXT_CAST pctxt,
 		/* TODO: error code. */
 		XML_SCHEMAP_SRC_REDEFINE,
@@ -20508,12 +20508,12 @@
 		"redefinition of the same component is not supported",
 		xmlSchemaGetComponentDesignation(&str, prev),
 		NULL);
-	    FREE_AND_NULL(str)	    
+	    FREE_AND_NULL(str)
 	    err = pctxt->err;
 	    redef = redef->next;
 	    continue;
 	}
-	redef = redef->next;	
+	redef = redef->next;
     } while (redef != NULL);
 
     return(err);
@@ -20527,7 +20527,7 @@
     xmlSchemaBasicItemPtr item;
 
     if (redef == NULL)
-	return(0);   	
+	return(0);
 
     do {
 	if (redef->target == NULL) {
@@ -20535,7 +20535,7 @@
 	    continue;
 	}
 	item = redef->item;
-		
+
 	switch (item->type) {
 	    case XML_SCHEMA_TYPE_SIMPLE:
 	    case XML_SCHEMA_TYPE_COMPLEX:
@@ -20544,7 +20544,7 @@
 		* type to be 'absent', we'll NULL it.
 		*/
 		(WXS_TYPE_CAST redef->target)->name = NULL;
-		
+
 		/*
 		* TODO: Seems like there's nothing more to do. The normal
 		* inheritance mechanism is used. But not 100% sure.
@@ -20593,7 +20593,7 @@
     } while (redef != NULL);
     return(0);
 }
-	
+
 
 static int
 xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
@@ -20627,8 +20627,8 @@
 	return(-1);
     if (bucket->flags & XML_SCHEMA_BUCKET_COMPS_ADDED)
 	return(0);
-    bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED; 
-    
+    bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED;
+
     for (i = 0; i < bucket->globals->nbItems; i++) {
 	item = bucket->globals->items[i];
 	table = NULL;
@@ -20669,12 +20669,12 @@
 	    case XML_SCHEMA_TYPE_NOTATION:
 		name = ((xmlSchemaNotationPtr) item)->name;
 		WXS_GET_GLOBAL_HASH(bucket, notaDecl)
-		break;	    
+		break;
 	    default:
 		PERROR_INT("xmlSchemaAddComponents",
 		    "Unexpected global component type");
-		continue;    		
-	}	
+		continue;
+	}
 	if (*table == NULL) {
 	    *table = xmlHashCreateDict(10, pctxt->dict);
 	    if (*table == NULL) {
@@ -20682,11 +20682,11 @@
 		    "failed to create a component hash table");
 		return(-1);
 	    }
-	}	
+	}
 	err = xmlHashAddEntry(*table, name, item);
-	if (err != 0) {	
+	if (err != 0) {
 	    xmlChar *str = NULL;
-	    
+
 	    xmlSchemaCustomErr(ACTXT_CAST pctxt,
 		XML_SCHEMAP_REDEFINED_TYPE,
 		WXS_ITEM_NODE(item),
@@ -20694,7 +20694,7 @@
 		"A global %s '%s' does already exist",
 		WXS_ITEM_TYPE_NAME(item),
 		xmlSchemaGetComponentQName(&str, item));
-	    FREE_AND_NULL(str);	 
+	    FREE_AND_NULL(str);
 	}
     }
     /*
@@ -20728,23 +20728,23 @@
 
     if ((con->pending == NULL) ||
 	(con->pending->nbItems == 0))
-	return(0);    
+	return(0);
 
     /*
     * Since xmlSchemaFixupComplexType() will create new particles
     * (local components), and those particle components need a bucket
     * on the constructor, we'll assure here that the constructor has
     * a bucket.
-    * TODO: Think about storing locals _only_ on the main bucket.    
-    */    
+    * TODO: Think about storing locals _only_ on the main bucket.
+    */
     if (con->bucket == NULL)
-	con->bucket = rootBucket;    
+	con->bucket = rootBucket;
 
     /* TODO:
     * SPEC (src-redefine):
     * (6.2) "If it has no such self-reference, then all of the
     * following must be true:"
-    
+
     * (6.2.2) The {model group} of the model group definition which
     * corresponds to it per XML Representation of Model Group
     * Definition Schema Components (§3.7.2) must be a ·valid
@@ -20755,7 +20755,7 @@
 
     /*
     * Add global components to the schemata's hash tables.
-    */    
+    */
     xmlSchemaAddComponents(pctxt, rootBucket);
 
     pctxt->ctxtType = NULL;
@@ -20765,7 +20765,7 @@
     * Now that we have parsed *all* the schema document(s) and converted
     * them to schema components, we can resolve references, apply component
     * constraints, create the FSA from the content model, etc.
-    */    
+    */
     /*
     * Resolve references of..
     *
@@ -20786,7 +20786,7 @@
     * 6. IDC key-references:
     *   - the referenced IDC 'key' or 'unique' definition
     * 7. Attribute prohibitions which had a "ref" attribute.
-    */        
+    */
     for (i = 0; i < nbItems; i++) {
 	item = items[i];
 	switch (item->type) {
@@ -20812,7 +20812,7 @@
 		FIXHFAILURE;
 		break;
 	    case XML_SCHEMA_EXTRA_QNAMEREF:
-		if ((WXS_QNAME_CAST item)->itemType == 
+		if ((WXS_QNAME_CAST item)->itemType ==
 		    XML_SCHEMA_TYPE_ATTRIBUTEGROUP)
 		{
 		    xmlSchemaResolveAttrGroupReferences(
@@ -20849,11 +20849,11 @@
     }
     if (pctxt->nberrors != 0)
 	goto exit_error;
-    
+
     /*
     * Now that all references are resolved we
     * can check for circularity of...
-    * 1. the base axis of type definitions 
+    * 1. the base axis of type definitions
     * 2. nested model group definitions
     * 3. nested attribute group definitions
     * TODO: check for circual substitution groups.
@@ -20888,7 +20888,7 @@
 		break;
 	    default:
 		break;
-	}	
+	}
     }
     if (pctxt->nberrors != 0)
 	goto exit_error;
@@ -20904,7 +20904,7 @@
 	item = items[i];
 	switch (item->type) {
 	    case XML_SCHEMA_TYPE_SEQUENCE:
-	    case XML_SCHEMA_TYPE_CHOICE:	
+	    case XML_SCHEMA_TYPE_CHOICE:
 		xmlSchemaModelGroupToModelGroupDefFixup(pctxt,
 		    WXS_MODEL_GROUP_CAST item);
 		break;
@@ -20935,7 +20935,7 @@
     }
     if (pctxt->nberrors != 0)
 	goto exit_error;
-    /* 
+    /*
     * First compute the variety of simple types. This is needed as
     * a seperate step, since otherwise we won't be able to detect
     * circular union types in all cases.
@@ -20965,7 +20965,7 @@
 	switch (item->type) {
             case XML_SCHEMA_TYPE_SIMPLE:
 		if (((xmlSchemaTypePtr) item)->memberTypes != NULL) {
-		    xmlSchemaCheckUnionTypeDefCircular(pctxt,	
+		    xmlSchemaCheckUnionTypeDefCircular(pctxt,
 			(xmlSchemaTypePtr) item);
 		    FIXHFAILURE;
 		}
@@ -20976,7 +20976,7 @@
     }
     if (pctxt->nberrors != 0)
 	goto exit_error;
-    
+
     /*
     * Do the complete type fixup for simple types.
     */
@@ -21004,10 +21004,10 @@
     for (i = 0; i < nbItems; i++) {
 	item = items[i];
 	switch (item->type) {
-	    case XML_SCHEMA_TYPE_ATTRIBUTE:		
+	    case XML_SCHEMA_TYPE_ATTRIBUTE:
 		xmlSchemaCheckAttrPropsCorrect(pctxt, WXS_ATTR_CAST item);
 		FIXHFAILURE;
-		break;	    
+		break;
 	    default:
 		break;
 	}
@@ -21016,7 +21016,7 @@
 	goto exit_error;
     /*
     * Apply constraints for attribute uses.
-    */    
+    */
     for (i = 0; i < nbItems; i++) {
 	item = items[i];
 	switch (item->type) {
@@ -21063,7 +21063,7 @@
     if (pctxt->nberrors != 0)
 	goto exit_error;
 
-    /*    
+    /*
     * Complex types are builded and checked.
     */
     for (i = 0; i < nbItems; i++) {
@@ -21087,8 +21087,8 @@
     * will create particles and model groups in some cases.
     */
     items = (xmlSchemaTreeItemPtr *) con->pending->items;
-    nbItems = con->pending->nbItems;    
-    
+    nbItems = con->pending->nbItems;
+
     /*
     * Apply some constraints for element declarations.
     */
@@ -21097,7 +21097,7 @@
 	switch (item->type) {
 	    case XML_SCHEMA_TYPE_ELEMENT:
 		elemDecl = (xmlSchemaElementPtr) item;
-		
+
 		if ((elemDecl->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0)
 		{
 		    xmlSchemaCheckElementDeclComponent(
@@ -21127,7 +21127,7 @@
     }
     if (pctxt->nberrors != 0)
 	goto exit_error;
- 
+
     /*
     * Finally we can build the automaton from the content model of
     * complex types.
@@ -21148,10 +21148,10 @@
 	goto exit_error;
     /*
     * URGENT TODO: cos-element-consistent
-    */        
-    goto exit;    
+    */
+    goto exit;
 
-exit_error:    
+exit_error:
     ret = pctxt->err;
     goto exit;
 
@@ -21165,12 +21165,12 @@
     * if not cleared here.
     */
     con->bucket = oldbucket;
-    con->pending->nbItems = 0;    
+    con->pending->nbItems = 0;
     if (con->substGroups != NULL) {
 	xmlHashFree(con->substGroups,
 	    (xmlHashDeallocator) xmlSchemaSubstGroupFree);
 	con->substGroups = NULL;
-    }    
+    }
     if (con->redefs != NULL) {
 	xmlSchemaRedefListFree(con->redefs);
 	con->redefs = NULL;
@@ -21233,11 +21233,11 @@
     if (res == -1)
 	goto exit_failure;
     if (res != 0)
-	goto exit;   
+	goto exit;
 
     if (bucket == NULL) {
 	/* TODO: Error code, actually we failed to *locate* the schema. */
-	if (ctxt->URL) 
+	if (ctxt->URL)
 	    xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
 		NULL, NULL,
 		"Failed to locate the main schema resource at '%s'",
@@ -21248,16 +21248,16 @@
 		"Failed to locate the main schema resource",
 		    NULL, NULL);
 	goto exit;
-    }        
+    }
     /* Then do the parsing for good. */
     if (xmlSchemaParseNewDocWithContext(ctxt, mainSchema, bucket) == -1)
 	goto exit_failure;
     if (ctxt->nberrors != 0)
 	goto exit;
-    
+
     mainSchema->doc = bucket->doc;
     mainSchema->preserve = ctxt->preserve;
-    
+
     ctxt->schema = mainSchema;
 
     if (xmlSchemaFixupComponents(ctxt, WXS_CONSTRUCTOR(ctxt)->mainBucket) == -1)
@@ -21267,8 +21267,8 @@
     * TODO: This is not nice, since we cannot distinguish from the
     * result if there was an internal error or not.
     */
-exit:       
-    if (ctxt->nberrors != 0) {	
+exit:
+    if (ctxt->nberrors != 0) {
 	if (mainSchema) {
 	    xmlSchemaFree(mainSchema);
 	    mainSchema = NULL;
@@ -21282,7 +21282,7 @@
     ctxt->schema = NULL;
     return(mainSchema);
 exit_failure:
-    /* 
+    /*
     * Quite verbose, but should catch internal errors, which were
     * not communitated.
     */
@@ -21296,7 +21296,7 @@
 	ctxt->ownsConstructor = 0;
     }
     PERROR_INT2("xmlSchemaParse",
-	"An internal error occured");    
+	"An internal error occured");
     ctxt->schema = NULL;
     return(NULL);
 }
@@ -21521,11 +21521,11 @@
     * XML_SCHEMA_SCHEMA_MAIN if it is the first schema document.
     */
     ret = xmlSchemaAddSchemaDoc(pctxt, XML_SCHEMA_SCHEMA_IMPORT,
-	location, NULL, NULL, 0, node, NULL, nsName, 
+	location, NULL, NULL, 0, node, NULL, nsName,
 	&bucket);
     if (ret != 0)
-	return(ret);    
-    if (bucket == NULL) {	
+	return(ret);
+    if (bucket == NULL) {
 	/*
 	* Generate a warning that the document could not be located.
 	*/
@@ -21555,17 +21555,17 @@
     pctxt->nberrors = 0;
     pctxt->err = 0;
     pctxt->doc = bucket->doc;
-    
-    ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);        
+
+    ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
     if (ret == -1) {
 	pctxt->doc = NULL;
 	goto exit_failure;
     }
     /* Paranoid error channelling. */
     if ((ret == 0) && (pctxt->nberrors != 0))
-	ret = pctxt->err;    
-    if (pctxt->nberrors == 0) {	
-	/* 
+	ret = pctxt->err;
+    if (pctxt->nberrors == 0) {
+	/*
 	* Only bother to fixup pending components, if there was
 	* no error yet.
 	* For every XSI acquired schema (and its sub-schemata) we will
@@ -21581,7 +21581,7 @@
 	    vctxt->err = ret;
 	vctxt->nberrors += pctxt->nberrors;
     } else {
-	/* Add to validation error sum. */ 
+	/* Add to validation error sum. */
 	vctxt->nberrors += pctxt->nberrors;
     }
     pctxt->doc = NULL;
@@ -21592,7 +21592,7 @@
 }
 
 static xmlSchemaAttrInfoPtr
-xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,		      
+xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
 			 int metaType)
 {
     if (vctxt->nbAttrInfos == 0)
@@ -21682,7 +21682,7 @@
 		/*
 		* If using @schemaLocation then tuples are expected.
 		* I.e. the namespace name *and* the document's URI.
-		*/		
+		*/
 		xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
 		    iattr->node, NULL,
 		    "The value must consist of tuples: the target namespace "
@@ -21711,7 +21711,7 @@
     if (vctxt->sax != NULL) {
 	int i, j;
 	xmlSchemaNodeInfoPtr inode;
-	
+
 	for (i = vctxt->depth; i >= 0; i--) {
 	    if (vctxt->elemInfos[i]->nbNsBindings != 0) {
 		inode = vctxt->elemInfos[i];
@@ -21725,7 +21725,7 @@
 			* Note that the namespace bindings are already
 			* in a string dict.
 			*/
-			return (inode->nsBindings[j+1]);			
+			return (inode->nsBindings[j+1]);
 		    }
 		}
 	    }
@@ -21734,7 +21734,7 @@
 #ifdef LIBXML_WRITER_ENABLED
     } else if (vctxt->reader != NULL) {
 	xmlChar *nsName;
-	
+
 	nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix);
 	if (nsName != NULL) {
 	    const xmlChar *ret;
@@ -21766,7 +21766,7 @@
 * This one works on the schema of the validation context.
 */
 static int
-xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt, 			  
+xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
 			  xmlSchemaPtr schema,
 			  xmlNodePtr node,
 			  const xmlChar *value,
@@ -21791,7 +21791,7 @@
 	if (prefix != NULL) {
 	    const xmlChar *nsName = NULL;
 
-	    if (vctxt != NULL) 
+	    if (vctxt != NULL)
 		nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix);
 	    else if (node != NULL) {
 		xmlNsPtr ns = xmlSearchNs(node->doc, node, prefix);
@@ -22143,7 +22143,7 @@
     if (bind->nodeTable != NULL)
 	xmlFree(bind->nodeTable);
     if (bind->dupls != NULL)
-	xmlSchemaItemListFree(bind->dupls);	
+	xmlSchemaItemListFree(bind->dupls);
     xmlFree(bind);
 }
 
@@ -22178,12 +22178,12 @@
 
     while (matcher != NULL) {
 	next = matcher->next;
-	if (matcher->keySeqs != NULL) {	    
+	if (matcher->keySeqs != NULL) {
 	    int i;
 	    for (i = 0; i < matcher->sizeKeySeqs; i++)
 		if (matcher->keySeqs[i] != NULL)
 		    xmlFree(matcher->keySeqs[i]);
-	    xmlFree(matcher->keySeqs);	    
+	    xmlFree(matcher->keySeqs);
 	}
 	if (matcher->targets != NULL) {
 	    if (matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) {
@@ -22223,7 +22223,7 @@
 
     while (matcher != NULL) {
 	next = matcher->next;
-	if (matcher->keySeqs != NULL) {	    
+	if (matcher->keySeqs != NULL) {
 	    int i;
 	    /*
 	    * Don't free the array, but only the content.
@@ -22252,7 +22252,7 @@
 	    }
 	    xmlSchemaItemListFree(matcher->targets);
 	    matcher->targets = NULL;
-	}	
+	}
 	matcher->next = NULL;
 	/*
 	* Cache the matcher.
@@ -22294,7 +22294,7 @@
 	sto = vctxt->xpathStatePool;
 	vctxt->xpathStatePool = sto->next;
 	sto->next = NULL;
-    } else {	
+    } else {
 	/*
 	* Create a new state object.
 	*/
@@ -22305,10 +22305,10 @@
 	    return (-1);
 	}
 	memset(sto, 0, sizeof(xmlSchemaIDCStateObj));
-    }	
+    }
     /*
-    * Add to global list. 
-    */	
+    * Add to global list.
+    */
     if (vctxt->xpathStates != NULL)
 	sto->next = vctxt->xpathStates;
     vctxt->xpathStates = sto;
@@ -22328,13 +22328,13 @@
 	VERROR_INT("xmlSchemaIDCAddStateObject",
 	    "failed to create an XPath validation context");
 	return (-1);
-    }    
+    }
     sto->type = type;
     sto->depth = vctxt->depth;
     sto->matcher = matcher;
     sto->sel = sel;
     sto->nbHistory = 0;
-    
+
 #ifdef DEBUG_IDC
     xmlGenericError(xmlGenericErrorContext, "IDC:   STO push '%s'\n",
 	sto->sel->xpath);
@@ -22358,7 +22358,7 @@
 {
     xmlSchemaIDCStateObjPtr sto, head = NULL, first;
     int res, resolved = 0, depth = vctxt->depth;
-        
+
     if (vctxt->xpathStates == NULL)
 	return (0);
 
@@ -22367,8 +22367,8 @@
 #ifdef DEBUG_IDC
     {
 	xmlChar *str = NULL;
-	xmlGenericError(xmlGenericErrorContext, 
-	    "IDC: EVAL on %s, depth %d, type %d\n",	    
+	xmlGenericError(xmlGenericErrorContext,
+	    "IDC: EVAL on %s, depth %d, type %d\n",
 	    xmlSchemaFormatQName(&str, vctxt->inode->nsName,
 		vctxt->inode->localName), depth, nodeType);
 	FREE_AND_NULL(str)
@@ -22382,10 +22382,10 @@
     while (sto != head) {
 #ifdef DEBUG_IDC
 	if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR)
-	    xmlGenericError(xmlGenericErrorContext, "IDC:   ['%s'] selector '%s'\n", 
+	    xmlGenericError(xmlGenericErrorContext, "IDC:   ['%s'] selector '%s'\n",
 		sto->matcher->aidc->def->name, sto->sel->xpath);
 	else
-	    xmlGenericError(xmlGenericErrorContext, "IDC:   ['%s'] field '%s'\n", 
+	    xmlGenericError(xmlGenericErrorContext, "IDC:   ['%s'] field '%s'\n",
 		sto->matcher->aidc->def->name, sto->sel->xpath);
 #endif
 	if (nodeType == XML_ELEMENT_NODE)
@@ -22415,7 +22415,7 @@
 	if (sto->history == NULL) {
 	    sto->history = (int *) xmlMalloc(5 * sizeof(int));
 	    if (sto->history == NULL) {
-		xmlSchemaVErrMemory(NULL, 
+		xmlSchemaVErrMemory(NULL,
 		    "allocating the state object history", NULL);
 		return(-1);
 	    }
@@ -22425,11 +22425,11 @@
 	    sto->history = (int *) xmlRealloc(sto->history,
 		sto->sizeHistory * sizeof(int));
 	    if (sto->history == NULL) {
-		xmlSchemaVErrMemory(NULL, 
+		xmlSchemaVErrMemory(NULL,
 		    "re-allocating the state object history", NULL);
 		return(-1);
 	    }
-	}		
+	}
 	sto->history[sto->nbHistory++] = depth;
 
 #ifdef DEBUG_IDC
@@ -22498,7 +22498,7 @@
     *buf = xmlStrdup(BAD_CAST "[");
     for (i = 0; i < count; i++) {
 	*buf = xmlStrcat(*buf, BAD_CAST "'");
-	res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val, 
+	res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
 	    xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
 	    &value);
 	if (res == 0)
@@ -22556,7 +22556,7 @@
  *
  * Processes and pops the history items of the IDC state objects.
  * IDC key-sequences are validated/created on IDC bindings.
- * 
+ *
  * Returns 0 on success and -1 on internal errors.
  */
 static int
@@ -22575,13 +22575,13 @@
 #ifdef DEBUG_IDC
     {
 	xmlChar *str = NULL;
-	xmlGenericError(xmlGenericErrorContext, 
+	xmlGenericError(xmlGenericErrorContext,
 	    "IDC: BACK on %s, depth %d\n",
 	    xmlSchemaFormatQName(&str, vctxt->inode->nsName,
 		vctxt->inode->localName), vctxt->depth);
 	FREE_AND_NULL(str)
     }
-#endif    
+#endif
     /*
     * Evaluate the state objects.
     */
@@ -22607,14 +22607,14 @@
 	if (matchDepth != depth) {
 	    sto = sto->next;
 	    continue;
-	}	
+	}
 	if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_FIELD) {
 	    /*
 	    * NOTE: According to
 	    *   http://www.w3.org/Bugs/Public/show_bug.cgi?id=2198
 	    *   ... the simple-content of complex types is also allowed.
 	    */
-	    
+
 	    if (WXS_IS_COMPLEX(type)) {
 		if (WXS_HAS_SIMPLE_CONTENT(type)) {
 		    /*
@@ -22629,17 +22629,17 @@
 		    }
 		} else
 		    simpleType = NULL;
-	    } else 
+	    } else
 		simpleType = type;
 	    if (simpleType == NULL) {
 		xmlChar *str = NULL;
-	
+
 		/*
 		* Not qualified if the field resolves to a node of non
 		* simple type.
-		*/	
+		*/
 		xmlSchemaCustomErr(ACTXT_CAST vctxt,
-		    XML_SCHEMAV_CVC_IDC, NULL,		    
+		    XML_SCHEMAV_CVC_IDC, NULL,
 		    WXS_BASIC_CAST sto->matcher->aidc->def,
 		    "The XPath '%s' of a field of %s does evaluate to a node of "
 		    "non-simple type",
@@ -22649,7 +22649,7 @@
 		sto->nbHistory--;
 		goto deregister_check;
 	    }
-	    
+
 	    if ((key == NULL) && (vctxt->inode->val == NULL)) {
 		/*
 		* Failed to provide the normalized value; maybe
@@ -22665,13 +22665,13 @@
 		xmlSchemaIDCMatcherPtr matcher = sto->matcher;
 		xmlSchemaPSVIIDCKeyPtr *keySeq;
 		int pos, idx;
-		
+
 		/*
 		* The key will be anchored on the matcher's list of
 		* key-sequences. The position in this list is determined
 		* by the target node's depth relative to the matcher's
 		* depth of creation (i.e. the depth of the scope element).
-		* 
+		*
 		* Element        Depth    Pos   List-entries
 		* <scope>          0              NULL
 		*   <bar>          1              NULL
@@ -22682,23 +22682,23 @@
 		* The size of the list is only dependant on the depth of
 		* the tree.
 		* An entry will be NULLed in selector_leave, i.e. when
-		* we hit the target's 
-		*/		    
+		* we hit the target's
+		*/
 		pos = sto->depth - matcher->depth;
 		idx = sto->sel->index;
-		
+
 		/*
 		* Create/grow the array of key-sequences.
 		*/
 		if (matcher->keySeqs == NULL) {
-		    if (pos > 9) 
+		    if (pos > 9)
 			matcher->sizeKeySeqs = pos * 2;
 		    else
 			matcher->sizeKeySeqs = 10;
-		    matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **) 
+		    matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
 			xmlMalloc(matcher->sizeKeySeqs *
-			sizeof(xmlSchemaPSVIIDCKeyPtr *));			
-		    if (matcher->keySeqs == NULL) {		
+			sizeof(xmlSchemaPSVIIDCKeyPtr *));
+		    if (matcher->keySeqs == NULL) {
 			xmlSchemaVErrMemory(NULL,
 			    "allocating an array of key-sequences",
 			    NULL);
@@ -22707,9 +22707,9 @@
 		    memset(matcher->keySeqs, 0,
 			matcher->sizeKeySeqs *
 			sizeof(xmlSchemaPSVIIDCKeyPtr *));
-		} else if (pos >= matcher->sizeKeySeqs) {	
+		} else if (pos >= matcher->sizeKeySeqs) {
 		    int i = matcher->sizeKeySeqs;
-		    
+
 		    matcher->sizeKeySeqs *= 2;
 		    matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
 			xmlRealloc(matcher->keySeqs,
@@ -22725,15 +22725,15 @@
 		    * The array needs to be NULLed.
 		    * TODO: Use memset?
 		    */
-		    for (; i < matcher->sizeKeySeqs; i++) 
-			matcher->keySeqs[i] = NULL;			
+		    for (; i < matcher->sizeKeySeqs; i++)
+			matcher->keySeqs[i] = NULL;
 		}
-		
+
 		/*
 		* Get/create the key-sequence.
 		*/
-		keySeq = matcher->keySeqs[pos];		    
-		if (keySeq == NULL) {	
+		keySeq = matcher->keySeqs[pos];
+		if (keySeq == NULL) {
 		    goto create_sequence;
 		} else if (keySeq[idx] != NULL) {
 		    xmlChar *str = NULL;
@@ -22744,10 +22744,10 @@
 		    * node, evaluate to either an empty node-set or
 		    * a node-set with exactly one member, which must
 		    * have a simple type.
-		    * 
+		    *
 		    * The key was already set; report an error.
 		    */
-		    xmlSchemaCustomErr(ACTXT_CAST vctxt, 
+		    xmlSchemaCustomErr(ACTXT_CAST vctxt,
 			XML_SCHEMAV_CVC_IDC, NULL,
 			WXS_BASIC_CAST matcher->aidc->def,
 			"The XPath '%s' of a field of %s evaluates to a "
@@ -22758,27 +22758,27 @@
 		    sto->nbHistory--;
 		    goto deregister_check;
 		} else
-		    goto create_key;		
-		
+		    goto create_key;
+
 create_sequence:
 		/*
 		* Create a key-sequence.
 		*/
 		keySeq = (xmlSchemaPSVIIDCKeyPtr *) xmlMalloc(
-		    matcher->aidc->def->nbFields * 
+		    matcher->aidc->def->nbFields *
 		    sizeof(xmlSchemaPSVIIDCKeyPtr));
 		if (keySeq == NULL) {
-		    xmlSchemaVErrMemory(NULL, 
+		    xmlSchemaVErrMemory(NULL,
 			"allocating an IDC key-sequence", NULL);
-		    return(-1);			
-		}	
-		memset(keySeq, 0, matcher->aidc->def->nbFields * 
+		    return(-1);
+		}
+		memset(keySeq, 0, matcher->aidc->def->nbFields *
 		    sizeof(xmlSchemaPSVIIDCKeyPtr));
 		matcher->keySeqs[pos] = keySeq;
 create_key:
 		/*
 		* Create a key once per node only.
-		*/  
+		*/
 		if (key == NULL) {
 		    key = (xmlSchemaPSVIIDCKeyPtr) xmlMalloc(
 			sizeof(xmlSchemaPSVIIDCKey));
@@ -22787,7 +22787,7 @@
 			    "allocating a IDC key", NULL);
 			xmlFree(keySeq);
 			matcher->keySeqs[pos] = NULL;
-			return(-1);			
+			return(-1);
 		    }
 		    /*
 		    * Consume the compiled value.
@@ -22803,10 +22803,10 @@
 			return (-1);
 		    }
 		}
-		keySeq[idx] = key;		    
+		keySeq[idx] = key;
 	    }
 	} else if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) {
-		
+
 	    xmlSchemaPSVIIDCKeyPtr **keySeq = NULL;
 	    /* xmlSchemaPSVIIDCBindingPtr bind; */
 	    xmlSchemaPSVIIDCNodePtr ntItem;
@@ -22817,22 +22817,22 @@
 	    /*
 	    * Here we have the following scenario:
 	    * An IDC 'selector' state object resolved to a target node,
-	    * during the time this target node was in the 
-	    * ancestor-or-self axis, the 'field' state object(s) looked 
-	    * out for matching nodes to create a key-sequence for this 
+	    * during the time this target node was in the
+	    * ancestor-or-self axis, the 'field' state object(s) looked
+	    * out for matching nodes to create a key-sequence for this
 	    * target node. Now we are back to this target node and need
-	    * to put the key-sequence, together with the target node 
-	    * itself, into the node-table of the corresponding IDC 
+	    * to put the key-sequence, together with the target node
+	    * itself, into the node-table of the corresponding IDC
 	    * binding.
 	    */
 	    matcher = sto->matcher;
 	    idc = matcher->aidc->def;
 	    nbKeys = idc->nbFields;
-	    pos = depth - matcher->depth;		
+	    pos = depth - matcher->depth;
 	    /*
 	    * Check if the matcher has any key-sequences at all, plus
 	    * if it has a key-sequence for the current target node.
-	    */		
+	    */
 	    if ((matcher->keySeqs == NULL) ||
 		(matcher->sizeKeySeqs <= pos)) {
 		if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
@@ -22840,15 +22840,15 @@
 		else
 		    goto selector_leave;
 	    }
-	    
-	    keySeq = &(matcher->keySeqs[pos]);		
+
+	    keySeq = &(matcher->keySeqs[pos]);
 	    if (*keySeq == NULL) {
 		if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
 		    goto selector_key_error;
 		else
 		    goto selector_leave;
 	    }
-	    
+
 	    for (i = 0; i < nbKeys; i++) {
 		if ((*keySeq)[i] == NULL) {
 		    /*
@@ -22859,14 +22859,14 @@
 			* All fields of a "key" IDC must resolve.
 			*/
 			goto selector_key_error;
-		    }		    
+		    }
 		    goto selector_leave;
 		}
 	    }
 	    /*
 	    * All fields did resolve.
 	    */
-	    
+
 	    /*
 	    * 4.1 If the {identity-constraint category} is unique(/key),
 	    * then no two members of the ·qualified node set· have
@@ -22880,10 +22880,10 @@
 	    bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
 #endif
 	    targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher);
-	    if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) && 
+	    if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
 		(targets->nbItems != 0)) {
 		xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq;
-		
+
 		i = 0;
 		res = 0;
 		/*
@@ -22894,7 +22894,7 @@
 			((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys;
 		    for (j = 0; j < nbKeys; j++) {
 			ckey = (*keySeq)[j];
-			bkey = bkeySeq[j];							
+			bkey = bkeySeq[j];
 			res = xmlSchemaAreValuesEqual(ckey->val, bkey->val);
 			if (res == -1) {
 			    return (-1);
@@ -22916,10 +22916,10 @@
 		} while (i < targets->nbItems);
 		if (i != targets->nbItems) {
 		    xmlChar *str = NULL, *strB = NULL;
-		    /*   
+		    /*
 		    * TODO: Try to report the key-sequence.
 		    */
-		    xmlSchemaCustomErr(ACTXT_CAST vctxt, 
+		    xmlSchemaCustomErr(ACTXT_CAST vctxt,
 			XML_SCHEMAV_CVC_IDC, NULL,
 			WXS_BASIC_CAST idc,
 			"Duplicate key-sequence %s in %s",
@@ -22937,15 +22937,15 @@
 	    ntItem = (xmlSchemaPSVIIDCNodePtr) xmlMalloc(
 		sizeof(xmlSchemaPSVIIDCNode));
 	    if (ntItem == NULL) {
-		xmlSchemaVErrMemory(NULL, 
+		xmlSchemaVErrMemory(NULL,
 		    "allocating an IDC node-table item", NULL);
 		xmlFree(*keySeq);
 		*keySeq = NULL;
 		return(-1);
-	    }	
+	    }
 	    memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode));
-	    
-	    /* 
+
+	    /*
 	    * Store the node-table item in a global list.
 	    */
 	    if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) {
@@ -22967,7 +22967,7 @@
 		    xmlFree(ntItem);
 		    xmlFree(*keySeq);
 		    *keySeq = NULL;
-		    return (-1);		    
+		    return (-1);
 		}
 	    }
 	    /*
@@ -22979,11 +22979,11 @@
 	    ntItem->keys = *keySeq;
 	    *keySeq = NULL;
 #if 0
-	    if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) {
+	    if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1)
 #endif
 	    if (xmlSchemaItemListAdd(targets, ntItem) == -1) {
 		if (idc->type == XML_SCHEMA_TYPE_IDC_KEYREF) {
-		    /* 
+		    /*
 		    * Free the item, since keyref items won't be
 		    * put on a global list.
 		    */
@@ -22992,18 +22992,18 @@
 		}
 		return (-1);
 	    }
-	    
+
 	    goto selector_leave;
 selector_key_error:
 	    {
 		xmlChar *str = NULL;
 		/*
-		* 4.2.1 (KEY) The ·target node set· and the 
-		* ·qualified node set· are equal, that is, every 
+		* 4.2.1 (KEY) The ·target node set· and the
+		* ·qualified node set· are equal, that is, every
 		* member of the ·target node set· is also a member
 		* of the ·qualified node set· and vice versa.
 		*/
-		xmlSchemaCustomErr(ACTXT_CAST vctxt, 
+		xmlSchemaCustomErr(ACTXT_CAST vctxt,
 		    XML_SCHEMAV_CVC_IDC, NULL,
 		    WXS_BASIC_CAST idc,
 		    "Not all fields of %s evaluate to a node",
@@ -23019,7 +23019,7 @@
 		*keySeq = NULL;
 	    }
 	} /* if selector */
-	
+
 	sto->nbHistory--;
 
 deregister_check:
@@ -23070,15 +23070,15 @@
     xmlSchemaIDCMatcherPtr matcher, last = NULL;
     xmlSchemaIDCPtr idc, refIdc;
     xmlSchemaIDCAugPtr aidc;
-        
+
     idc = (xmlSchemaIDCPtr) elemDecl->idcs;
     if (idc == NULL)
 	return (0);
-    
+
 #ifdef DEBUG_IDC
     {
 	xmlChar *str = NULL;
-	xmlGenericError(xmlGenericErrorContext, 
+	xmlGenericError(xmlGenericErrorContext,
 	    "IDC: REGISTER on %s, depth %d\n",
 	    (char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName,
 		vctxt->inode->localName), vctxt->depth);
@@ -23119,7 +23119,7 @@
 			"Could not find an augmented IDC item for an IDC "
 			"definition");
 		    return (-1);
-		}		
+		}
 		if ((aidc->keyrefDepth == -1) ||
 		    (vctxt->depth < aidc->keyrefDepth))
 		    aidc->keyrefDepth = vctxt->depth;
@@ -23150,10 +23150,10 @@
 	    vctxt->idcMatcherCache = matcher->nextCached;
 	    matcher->nextCached = NULL;
 	} else {
-	    matcher = (xmlSchemaIDCMatcherPtr) 
+	    matcher = (xmlSchemaIDCMatcherPtr)
 		xmlMalloc(sizeof(xmlSchemaIDCMatcher));
 	    if (matcher == NULL) {
-		xmlSchemaVErrMemory(vctxt, 
+		xmlSchemaVErrMemory(vctxt,
 		    "allocating an IDC matcher", NULL);
 		return (-1);
 	    }
@@ -23166,16 +23166,16 @@
 	last = matcher;
 
 	matcher->type = IDC_MATCHER;
-	matcher->depth = vctxt->depth;	
+	matcher->depth = vctxt->depth;
 	matcher->aidc = aidc;
 	matcher->idcType = aidc->def->type;
-#ifdef DEBUG_IDC	
+#ifdef DEBUG_IDC
 	xmlGenericError(xmlGenericErrorContext, "IDC:   register matcher\n");
-#endif 
+#endif
 	/*
-	* Init the automaton state object. 
+	* Init the automaton state object.
 	*/
-	if (xmlSchemaIDCAddStateObject(vctxt, matcher, 
+	if (xmlSchemaIDCAddStateObject(vctxt, matcher,
 	    idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1)
 	    return (-1);
 
@@ -23192,7 +23192,7 @@
     int res, i, j, k, nbTargets, nbFields, nbDupls, nbNodeTable;
     xmlSchemaPSVIIDCKeyPtr *keys, *ntkeys;
     xmlSchemaPSVIIDCNodePtr *targets, *dupls;
-    
+
     xmlSchemaIDCMatcherPtr matcher = ielem->idcMatchers;
     /* vctxt->createIDCNodeTables */
     while (matcher != NULL) {
@@ -23226,7 +23226,7 @@
 	    nbDupls = bind->dupls->nbItems;
 	} else {
 	    dupls = NULL;
-	    nbDupls = 0;	    
+	    nbDupls = 0;
 	}
 	if (bind->nodeTable != NULL) {
 	    nbNodeTable = bind->nbNodes;
@@ -23239,29 +23239,29 @@
 	    * Transfer all IDC target-nodes to the IDC node-table.
 	    */
 	    bind->nodeTable =
-		(xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;		
+		(xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
 	    bind->sizeNodes = matcher->targets->sizeItems;
 	    bind->nbNodes = matcher->targets->nbItems;
 
 	    matcher->targets->items = NULL;
 	    matcher->targets->sizeItems = 0;
-	    matcher->targets->nbItems = 0;	    
+	    matcher->targets->nbItems = 0;
 	} else {
 	    /*
 	    * Compare the key-sequences and add to the IDC node-table.
 	    */
 	    nbTargets = matcher->targets->nbItems;
-	    targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;	
+	    targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
 	    nbFields = matcher->aidc->def->nbFields;
 	    i = 0;
 	    do {
 		keys = targets[i]->keys;
-		if (nbDupls) {			
+		if (nbDupls) {
 		    /*
 		    * Search in already found duplicates first.
 		    */
 		    j = 0;
-		    do {						
+		    do {
 			if (nbFields == 1) {
 			    res = xmlSchemaAreValuesEqual(keys[0]->val,
 				dupls[j]->keys[0]->val);
@@ -23296,11 +23296,11 @@
 			    }
 			}
 			j++;
-		    } while (j < nbDupls);		    
+		    } while (j < nbDupls);
 		}
 		if (nbNodeTable) {
 		    j = 0;
-		    do {						
+		    do {
 			if (nbFields == 1) {
 			    res = xmlSchemaAreValuesEqual(keys[0]->val,
 				bind->nodeTable[j]->keys[0]->val);
@@ -23327,7 +23327,7 @@
 				    goto next_node_table_entry;
 				}
 			    }
-			}			
+			}
 			/*
 			* Add the duplicate to the list of duplicates.
 			*/
@@ -23335,7 +23335,7 @@
 			    bind->dupls = xmlSchemaItemListCreate();
 			    if (bind->dupls == NULL)
 				goto internal_error;
-			}		    
+			}
 			if (xmlSchemaItemListAdd(bind->dupls, bind->nodeTable[j]) == -1)
 			    goto internal_error;
 			/*
@@ -23370,12 +23370,12 @@
 }
 
 /**
- * xmlSchemaBubbleIDCNodeTables: 
+ * xmlSchemaBubbleIDCNodeTables:
  * @depth: the current tree depth
  *
- * Merges IDC bindings of an element at @depth into the corresponding IDC 
- * bindings of its parent element. If a duplicate note-table entry is found, 
- * both, the parent node-table entry and child entry are discarded from the 
+ * Merges IDC bindings of an element at @depth into the corresponding IDC
+ * bindings of its parent element. If a duplicate note-table entry is found,
+ * both, the parent node-table entry and child entry are discarded from the
  * node-table of the parent.
  *
  * Returns 0 if OK and -1 on internal errors.
@@ -23389,19 +23389,19 @@
     xmlSchemaIDCAugPtr aidc;
     int i, j, k, ret = 0, nbFields, oldNum, oldDupls;
 
-    bind = vctxt->inode->idcTable;        
+    bind = vctxt->inode->idcTable;
     if (bind == NULL) {
 	/* Fine, no table, no bubbles. */
 	return (0);
     }
-    
+
     parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable);
     /*
     * Walk all bindings; create new or add to existing bindings.
     * Remove duplicate key-sequences.
     */
     while (bind != NULL) {
-	
+
 	if ((bind->nbNodes == 0) && WXS_ILIST_IS_EMPTY(bind->dupls))
 	    goto next_binding;
 	/*
@@ -23411,7 +23411,7 @@
 	    aidc = vctxt->aidcs;
 	    do {
 		if (aidc->def == bind->definition) {
-		    if ((aidc->keyrefDepth == -1) || 
+		    if ((aidc->keyrefDepth == -1) ||
 			(aidc->keyrefDepth >= vctxt->depth)) {
 			goto next_binding;
 		    }
@@ -23427,7 +23427,7 @@
 	* Search a matching parent binding for the
 	* IDC definition.
 	*/
-	while (parBind != NULL) {	    
+	while (parBind != NULL) {
 	    if (parBind->definition == bind->definition)
 		break;
 	    parBind = parBind->next;
@@ -23435,7 +23435,7 @@
 
 	if (parBind != NULL) {
 	    /*
-	    * Compare every node-table entry of the child node, 
+	    * Compare every node-table entry of the child node,
 	    * i.e. the key-sequence within, ...
 	    */
 	    oldNum = parBind->nbNodes; /* Skip newly added items. */
@@ -23445,12 +23445,12 @@
 		dupls = (xmlSchemaPSVIIDCNodePtr *) parBind->dupls->items;
 	    } else {
 		dupls = NULL;
-		oldDupls = 0;		
+		oldDupls = 0;
 	    }
-	    
+
 	    parNodes = parBind->nodeTable;
 	    nbFields = bind->definition->nbFields;
-	    
+
 	    for (i = 0; i < bind->nbNodes; i++) {
 		node = bind->nodeTable[i];
 		if (node == NULL)
@@ -23460,7 +23460,7 @@
 		* evaluated to be a duplicate key-sequence.
 		*/
 		if (oldDupls) {
-		    j = 0; 
+		    j = 0;
 		    while (j < oldDupls) {
 			if (nbFields == 1) {
 			    ret = xmlSchemaAreValuesEqual(
@@ -23493,12 +23493,12 @@
 			/* Duplicate found. Skip this entry. */
 			continue;
 		    }
-		}		    
+		}
 		/*
 		* ... and with every key-sequence of the parent node.
 		*/
 		if (oldNum) {
-		    j = 0; 
+		    j = 0;
 		    while (j < oldNum) {
 			parNode = parNodes[j];
 			if (nbFields == 1) {
@@ -23511,7 +23511,7 @@
 				j++;
 				continue;
 			    }
-			} else {			    
+			} else {
 			    for (k = 0; k < nbFields; k++) {
 				ret = xmlSchemaAreValuesEqual(
 				    node->keys[k]->val,
@@ -23532,20 +23532,20 @@
 			* Handle duplicates. Move the duplicate in
 			* the parent's node-table to the list of
 			* duplicates.
-			*/			
+			*/
 			oldNum--;
 			parBind->nbNodes--;
 			/*
 			* Move last old item to pos of duplicate.
 			*/
 			parNodes[j] = parNodes[oldNum];
-			
+
 			if (parBind->nbNodes != oldNum) {
 			    /*
-			    * If new items exist, move last new item to 
+			    * If new items exist, move last new item to
 			    * last of old items.
 			    */
-			    parNodes[oldNum] = 
+			    parNodes[oldNum] =
 				parNodes[parBind->nbNodes];
 			}
 			if (parBind->dupls == NULL) {
@@ -23553,31 +23553,31 @@
 			    if (parBind->dupls == NULL)
 				goto internal_error;
 			}
-			xmlSchemaItemListAdd(parBind->dupls, parNode);			
+			xmlSchemaItemListAdd(parBind->dupls, parNode);
 		    } else {
 			/*
-			* Add the node-table entry (node and key-sequence) of 
+			* Add the node-table entry (node and key-sequence) of
 			* the child node to the node table of the parent node.
 			*/
-			if (parBind->nodeTable == NULL) {			
-			    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) 
+			if (parBind->nodeTable == NULL) {
+			    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
 				xmlMalloc(10 * sizeof(xmlSchemaPSVIIDCNodePtr));
 			    if (parBind->nodeTable == NULL) {
-				xmlSchemaVErrMemory(NULL, 
+				xmlSchemaVErrMemory(NULL,
 				    "allocating IDC list of node-table items", NULL);
 				goto internal_error;
 			    }
 			    parBind->sizeNodes = 1;
 			} else if (parBind->nbNodes >= parBind->sizeNodes) {
 			    parBind->sizeNodes *= 2;
-			    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) 
-				xmlRealloc(parBind->nodeTable, parBind->sizeNodes * 
+			    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
+				xmlRealloc(parBind->nodeTable, parBind->sizeNodes *
 				sizeof(xmlSchemaPSVIIDCNodePtr));
 			    if (parBind->nodeTable == NULL) {
-				xmlSchemaVErrMemory(NULL, 
+				xmlSchemaVErrMemory(NULL,
 				    "re-allocating IDC list of node-table items", NULL);
 				goto internal_error;
-			    }			    
+			    }
 			}
 			parNodes = parBind->nodeTable;
 			/*
@@ -23587,9 +23587,9 @@
 			parNodes[parBind->nbNodes++] = node;
 		    }
 
-		}	
-		
-	    }	
+		}
+
+	    }
 	} else {
 	    /*
 	    * No binding for the IDC was found: create a new one and
@@ -23598,7 +23598,7 @@
 	    parBind = xmlSchemaIDCNewBinding(bind->definition);
 	    if (parBind == NULL)
 		goto internal_error;
-	    
+
 	    /*
 	    * TODO: Hmm, how to optimize the initial number of
 	    * allocated entries?
@@ -23624,11 +23624,11 @@
 		    /*
 		    * Copy the entries.
 		    */
-		    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) 
+		    parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
 			xmlMalloc(bind->nbNodes *
 			sizeof(xmlSchemaPSVIIDCNodePtr));
 		    if (parBind->nodeTable == NULL) {
-			xmlSchemaVErrMemory(NULL, 
+			xmlSchemaVErrMemory(NULL,
 			    "allocating an array of IDC node-table "
 			    "items", NULL);
 			xmlSchemaIDCFreeBinding(parBind);
@@ -23647,15 +23647,15 @@
 		if (parBind->dupls != NULL)
 		    xmlSchemaItemListFree(parBind->dupls);
 		parBind->dupls = bind->dupls;
-		bind->dupls = NULL;		
+		bind->dupls = NULL;
 	    }
 	    if (*parTable == NULL)
 		*parTable = parBind;
 	    else {
 		parBind->next = *parTable;
 		*parTable = parBind;
-	    }	   
-	}	
+	    }
+	}
 
 next_binding:
 	bind = bind->next;
@@ -23678,7 +23678,7 @@
 {
     xmlSchemaIDCMatcherPtr matcher;
     xmlSchemaPSVIIDCBindingPtr bind;
-    
+
     matcher = vctxt->inode->idcMatchers;
     /*
     * Find a keyref.
@@ -23699,7 +23699,7 @@
 	    */
 	    bind = vctxt->inode->idcTable;
 	    while (bind != NULL) {
-		if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item == 
+		if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item ==
 		    bind->definition)
 		    break;
 		bind = bind->next;
@@ -23768,7 +23768,7 @@
 			}
 		    }
 		}
-		
+
 		if (res == 0) {
 		    xmlChar *str = NULL, *strB = NULL;
 		    xmlSchemaKeyrefErr(vctxt,
@@ -23852,7 +23852,7 @@
 			xmlNodePtr attrNode,
 			int nodeLine,
 			const xmlChar *localName,
-			const xmlChar *nsName,			
+			const xmlChar *nsName,
 			int ownedNames,
 			xmlChar *value,
 			int ownedValue)
@@ -23878,7 +23878,7 @@
     if (nsName != NULL) {
 	if (xmlStrEqual(localName, BAD_CAST "nil")) {
 	    if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
-		attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;		
+		attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;
 	    }
 	} else if (xmlStrEqual(localName, BAD_CAST "type")) {
 	    if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
@@ -24099,7 +24099,7 @@
 	valType = valType;
     else
 	valType = xmlSchemaGetValType(val);
-    
+
     ret = 0;
     for (facetLink = type->facetSet; facetLink != NULL;
 	facetLink = facetLink->next) {
@@ -24148,11 +24148,11 @@
     ret = 0;
     for (facetLink = type->facetSet; facetLink != NULL;
 	facetLink = facetLink->next) {
-	
+
 	switch (facetLink->facet->type) {
 	    case XML_SCHEMA_FACET_LENGTH:
 	    case XML_SCHEMA_FACET_MINLENGTH:
-	    case XML_SCHEMA_FACET_MAXLENGTH:		    
+	    case XML_SCHEMA_FACET_MAXLENGTH:
 		ret = xmlSchemaValidateListSimpleTypeFacet(facetLink->facet,
 		    value, length, NULL);
 		break;
@@ -24164,7 +24164,7 @@
 		"validating against a list type facet");
 	    return (-1);
 	} else if (ret > 0) {
-	    if (fireErrors)		
+	    if (fireErrors)
 		xmlSchemaFacetErr(actxt, ret, node,
 		value, length, type, facetLink->facet, NULL, NULL, NULL);
 	    else
@@ -24241,7 +24241,7 @@
 		if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
 		    continue;
 		found = 1;
-		/* 
+		/*
 		* NOTE that for patterns, @value needs to be the
 		* normalized vaule.
 		*/
@@ -24253,7 +24253,7 @@
 			"validating against a pattern facet");
 		    return (-1);
 		} else {
-		    /* 
+		    /*
 		    * Save the last non-validating facet.
 		    */
 		    facet = facetLink->facet;
@@ -24276,12 +24276,12 @@
 
     return (error);
 }
- 
+
 static xmlChar *
 xmlSchemaNormalizeValue(xmlSchemaTypePtr type,
 			const xmlChar *value)
 {
-    switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {	
+    switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {
 	case XML_SCHEMA_WHITESPACE_COLLAPSE:
 	    return (xmlSchemaCollapseString(value));
 	case XML_SCHEMA_WHITESPACE_REPLACE:
@@ -24300,7 +24300,7 @@
     int ret;
     const xmlChar *nsName;
     xmlChar *local, *prefix = NULL;
-    
+
     ret = xmlValidateQName(value, 1);
     if (ret != 0) {
 	if (ret == -1) {
@@ -24323,7 +24323,7 @@
     *  - is there a default namespace?
     */
     nsName = xmlSchemaLookupNamespace(vctxt, prefix);
-    
+
     if (prefix != NULL) {
 	xmlFree(prefix);
 	/*
@@ -24380,7 +24380,7 @@
 	    value = normValue; \
 	isNormalized = 1; \
     }
-    
+
     if ((retVal != NULL) && (*retVal != NULL)) {
 	xmlSchemaFreeValue(*retVal);
 	*retVal = NULL;
@@ -24441,9 +24441,9 @@
 	* NOTATIONs need to be processed here, since they need
 	* to lookup in the hashtable of NOTATION declarations of the schema.
 	*/
-	if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {	    
-	    switch (biType->builtInType) {		
-		case XML_SCHEMAS_NOTATION:		    
+	if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
+	    switch (biType->builtInType) {
+		case XML_SCHEMAS_NOTATION:
 		    ret = xmlSchemaValidateNotation(
 			(xmlSchemaValidCtxtPtr) actxt,
 			((xmlSchemaValidCtxtPtr) actxt)->schema,
@@ -24463,8 +24463,8 @@
 			    value, NULL, NULL);
 		    break;
 	    }
-	} else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {	    
-	    switch (biType->builtInType) {		    
+	} else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
+	    switch (biType->builtInType) {
 		case XML_SCHEMAS_NOTATION:
 		    ret = xmlSchemaValidateNotation(NULL,
 			((xmlSchemaParserCtxtPtr) actxt)->schema, node,
@@ -24479,7 +24479,7 @@
 			ret = xmlSchemaValPredefTypeNodeNoNorm(biType,
 			    value, NULL, node);
 		    break;
-	    }	   
+	    }
 	} else {
 	    /*
 	    * Validation via a public API is not implemented yet.
@@ -24496,7 +24496,7 @@
 	    if (WXS_IS_LIST(type))
 		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
 	    else
-		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;	    
+		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
 	}
 	if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
 	    /*
@@ -24511,10 +24511,10 @@
 			"validating facets of atomic simple type");
 		    goto internal_error;
 		}
-		if (WXS_IS_LIST(type)) 
+		if (WXS_IS_LIST(type))
 		    ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
 		else
-		    ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;		
+		    ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
 	    }
 	}
 	if (fireErrors && (ret > 0))
@@ -24539,7 +24539,7 @@
 	* VAL TODO: Optimize validation of empty values.
 	* VAL TODO: We do not have computed values for lists.
 	*/
-	itemType = WXS_LIST_ITEMTYPE(type);	
+	itemType = WXS_LIST_ITEMTYPE(type);
 	cur = value;
 	do {
 	    while (IS_BLANK_CH(*cur))
@@ -24578,7 +24578,7 @@
 		}
 		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
 		break;
-	    }	    
+	    }
 	    cur = end;
 	} while (*cur != 0);
 	FREE_AND_NULL(tmpValue);
@@ -24599,7 +24599,7 @@
 	    }
 	}
 	if (fireErrors && (ret > 0)) {
-	    /* 
+	    /*
 	    * Report the normalized value.
 	    */
 	    normalize = 1;
@@ -24629,7 +24629,7 @@
 	    AERROR_INT("xmlSchemaVCheckCVCSimpleType",
 		"union simple type has no member types");
 	    goto internal_error;
-	}	
+	}
 	/*
 	* Always normalize union type values, since we currently
 	* cannot store the whitespace information with the value
@@ -24637,7 +24637,7 @@
 	* not possible.
 	*/
 	while (memberLink != NULL) {
-	    if (valNeeded) 
+	    if (valNeeded)
 		ret = xmlSchemaVCheckCVCSimpleType(actxt, node,
 		    memberLink->type, value, &val, 0, 1, 0);
 	    else
@@ -24674,7 +24674,7 @@
 			"validating facets of union simple type");
 		    goto internal_error;
 		}
-		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;		
+		ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;
 	    }
 	}
 	if (fireErrors && (ret > 0))
@@ -25089,11 +25089,11 @@
 static int
 xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
 {
-    xmlSchemaTypePtr type = vctxt->inode->typeDef;    
+    xmlSchemaTypePtr type = vctxt->inode->typeDef;
     xmlSchemaItemListPtr attrUseList;
     xmlSchemaAttributeUsePtr attrUse = NULL;
     xmlSchemaAttributePtr attrDecl = NULL;
-    xmlSchemaAttrInfoPtr iattr, tmpiattr;    
+    xmlSchemaAttrInfoPtr iattr, tmpiattr;
     int i, j, found, nbAttrs, nbUses;
     int xpathRes = 0, res, wildIDs = 0, fixed;
     xmlNodePtr defAttrOwnerElem = NULL;
@@ -25193,7 +25193,7 @@
 	    }
 	    tmpiattr->state = XML_SCHEMAS_ATTR_ERR_MISSING;
 	    tmpiattr->use = attrUse;
-	    tmpiattr->decl = attrDecl;	    
+	    tmpiattr->decl = attrDecl;
 	} else if ((attrUse->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
 	    ((attrUse->defValue != NULL) ||
 	     (attrDecl->defValue != NULL))) {
@@ -25421,7 +25421,7 @@
 	    * VAL TODO: Should we use the *normalized* value? This currently
 	    *   uses the *initial* value.
 	    */
-	    
+
 	    if (defAttrOwnerElem) {
 		xmlChar *normValue;
 		const xmlChar *value;
@@ -25513,7 +25513,7 @@
 	/*
 	* SPEC (cvc-attribute)
 	* (3) "The item's ·normalized value· must be locally ·valid·
-	* with respect to that {type definition} as per 
+	* with respect to that {type definition} as per
 	* String Valid (§3.14.4)."
 	*
 	* VAL TODO: Do we already have the
@@ -25534,7 +25534,7 @@
 		iattr->node, iattr->typeDef, iattr->value, NULL,
 		1, 0, 0);
 	}
-	    
+
 	if (res != 0) {
 	    if (res == -1) {
 		VERROR_INT("xmlSchemaVAttributesComplex",
@@ -25549,7 +25549,7 @@
 	    goto eval_idcs;
 	}
 
-	if (fixed) {	    
+	if (fixed) {
 	    /*
 	    * SPEC Attribute Locally Valid (Use) (cvc-au)
 	    * "For an attribute information item to be·valid·
@@ -25655,8 +25655,8 @@
 		xmlSchemaCustomErr(ACTXT_CAST vctxt,
 		    XML_SCHEMAV_CVC_AU, NULL, NULL,
 		    "The value '%s' does not match the fixed "
-		    "value constraint '%s'", 
-		    iattr->value, iattr->vcValue);		
+		    "value constraint '%s'",
+		    iattr->value, iattr->vcValue);
 		break;
 	    case XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL:
 		VERROR(XML_SCHEMAV_CVC_WILDCARD, NULL,
@@ -25718,7 +25718,7 @@
 	xmlSchemaElementPtr decl = NULL;
 
 	decl = xmlSchemaGetElem(vctxt->schema,
-	    vctxt->inode->localName, vctxt->inode->nsName);	    
+	    vctxt->inode->localName, vctxt->inode->nsName);
 	if (decl != NULL) {
 	    vctxt->inode->decl = decl;
 	    return (0);
@@ -25776,16 +25776,16 @@
 xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
 			      const xmlChar *value,
 			      xmlSchemaValPtr *val)
-{   
+{
     int ret = 0;
     xmlSchemaNodeInfoPtr inode = vctxt->inode;
 
     /*
     * cos-valid-default:
     * Schema Component Constraint: Element Default Valid (Immediate)
-    * For a string to be a valid default with respect to a type 
+    * For a string to be a valid default with respect to a type
     * definition the appropriate case among the following must be true:
-    */    
+    */
     if WXS_IS_COMPLEX(inode->typeDef) {
 	/*
 	* Complex type.
@@ -25793,7 +25793,7 @@
 	* SPEC (2.1) "its {content type} must be a simple type definition
 	* or mixed."
 	* SPEC (2.2.2) "If the {content type} is mixed, then the {content
-	* type}'s particle must be ·emptiable· as defined by 
+	* type}'s particle must be ·emptiable· as defined by
 	* Particle Emptiable (§3.9.6)."
 	*/
 	if ((! WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) &&
@@ -25807,18 +25807,18 @@
 		"or mixed content and a particle emptiable");
 	    return(ret);
 	}
-    }	
+    }
     /*
-    * 1 If the type definition is a simple type definition, then the string 
-    * must be ·valid· with respect to that definition as defined by String 
+    * 1 If the type definition is a simple type definition, then the string
+    * must be ·valid· with respect to that definition as defined by String
     * Valid (§3.14.4).
     *
     * AND
     *
-    * 2.2.1 If the {content type} is a simple type definition, then the 
-    * string must be ·valid· with respect to that simple type definition 
+    * 2.2.1 If the {content type} is a simple type definition, then the
+    * string must be ·valid· with respect to that simple type definition
     * as defined by String Valid (§3.14.4).
-    */  
+    */
     if (WXS_IS_SIMPLE(inode->typeDef)) {
 
 	ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
@@ -25832,7 +25832,7 @@
     if (ret < 0) {
 	VERROR_INT("xmlSchemaCheckCOSValidDefault",
 	    "calling xmlSchemaVCheckCVCSimpleType()");
-    }    
+    }
     return (ret);
 }
 
@@ -25866,13 +25866,13 @@
 
 static int
 xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt)
-{    
+{
     vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt);
     if (vctxt->inode == NULL) {
 	VERROR_INT("xmlSchemaValidatorPushElem",
 	    "calling xmlSchemaGetFreshElemInfo()");
 	return (-1);
-    }   
+    }
     vctxt->nbAttrInfos = 0;
     return (0);
 }
@@ -25895,7 +25895,7 @@
 
 
 
-/* 
+/*
 * Process END of element.
 */
 static int
@@ -25914,7 +25914,7 @@
 	*/
 	vctxt->skipDepth = vctxt->depth -1;
 	goto end_elem;
-    }    
+    }
     if ((inode->typeDef == NULL) ||
 	(inode->flags & XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE)) {
 	/*
@@ -25934,8 +25934,8 @@
 	* Workaround for "anyType".
 	*/
 	if (inode->typeDef->builtInType == XML_SCHEMAS_ANYTYPE)
-	    goto character_content;			
-	
+	    goto character_content;
+
 	if ((inode->flags & XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT) == 0) {
 	    xmlChar *values[10];
 	    int terminal, nbval = 10, nbneg;
@@ -25956,12 +25956,12 @@
 #ifdef DEBUG_AUTOMATA
 		xmlGenericError(xmlGenericErrorContext,
 		    "AUTOMATON create on '%s'\n", inode->localName);
-#endif	    
+#endif
 	    }
 	    /*
 	    * Get hold of the still expected content, since a further
 	    * call to xmlRegExecPushString() will loose this information.
-	    */ 
+	    */
 	    xmlRegExecNextValues(inode->regexCtxt,
 		&nbval, &nbneg, &values[0], &terminal);
 	    ret = xmlRegExecPushString(inode->regexCtxt, NULL, NULL);
@@ -26011,14 +26011,14 @@
 	/*
 	* Speedup if no declaration exists.
 	*/
-	if (WXS_IS_SIMPLE(inode->typeDef)) {	    
+	if (WXS_IS_SIMPLE(inode->typeDef)) {
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		inode, inode->typeDef, inode->value);
 	} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		inode, inode->typeDef->contentTypeDef,
 		inode->value);
-	}		
+	}
 	if (ret < 0) {
 	    VERROR_INT("xmlSchemaValidatorPopElem",
 		"calling xmlSchemaVCheckCVCSimpleType()");
@@ -26027,26 +26027,26 @@
 	goto end_elem;
     }
     /*
-    * cvc-elt (3.3.4) : 5 
+    * cvc-elt (3.3.4) : 5
     * The appropriate case among the following must be true:
     */
     /*
-    * cvc-elt (3.3.4) : 5.1 
-    * If the declaration has a {value constraint}, 
-    * the item has neither element nor character [children] and 
+    * cvc-elt (3.3.4) : 5.1
+    * If the declaration has a {value constraint},
+    * the item has neither element nor character [children] and
     * clause 3.2 has not applied, then all of the following must be true:
     */
     if ((inode->decl->value != NULL) &&
-	(inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) && 
+	(inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) &&
 	(! INODE_NILLED(inode))) {
 	/*
-	* cvc-elt (3.3.4) : 5.1.1 
+	* cvc-elt (3.3.4) : 5.1.1
 	* If the ·actual type definition· is a ·local type definition·
 	* then the canonical lexical representation of the {value constraint}
-	* value must be a valid default for the ·actual type definition· as 
-	* defined in Element Default Valid (Immediate) (§3.3.6). 
+	* value must be a valid default for the ·actual type definition· as
+	* defined in Element Default Valid (Immediate) (§3.3.6).
 	*/
-	/* 
+	/*
 	* NOTE: 'local' above means types acquired by xsi:type.
 	* NOTE: Although the *canonical* value is stated, it is not
 	* relevant if canonical or not. Additionally XML Schema 1.1
@@ -26069,22 +26069,22 @@
 	    * (see following).
 	    */
 	    goto default_psvi;
-	}	
+	}
 	/*
-	* cvc-elt (3.3.4) : 5.1.2 
-	* The element information item with the canonical lexical 
-	* representation of the {value constraint} value used as its 
-	* ·normalized value· must be ·valid· with respect to the 
+	* cvc-elt (3.3.4) : 5.1.2
+	* The element information item with the canonical lexical
+	* representation of the {value constraint} value used as its
+	* ·normalized value· must be ·valid· with respect to the
 	* ·actual type definition· as defined by Element Locally Valid (Type)
 	* (§3.3.4).
-	*/	    
+	*/
 	if (WXS_IS_SIMPLE(inode->typeDef)) {
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		inode, inode->typeDef, inode->decl->value);
 	} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		inode, inode->typeDef->contentTypeDef,
-		inode->decl->value);	    
+		inode->decl->value);
 	}
 	if (ret != 0) {
 	    if (ret < 0) {
@@ -26105,7 +26105,7 @@
 	    xmlChar *normValue;
 	    /*
 	    * VAL TODO: Normalize the value.
-	    */	    
+	    */
 	    normValue = xmlSchemaNormalizeValue(inode->typeDef,
 		inode->decl->value);
 	    if (normValue != NULL) {
@@ -26118,15 +26118,15 @@
 		    "calling xmlNewText()");
 		goto internal_error;
 	    } else
-		xmlAddChild(inode->node, textChild);	    
+		xmlAddChild(inode->node, textChild);
 	}
-	
-    } else if (! INODE_NILLED(inode)) {	
+
+    } else if (! INODE_NILLED(inode)) {
 	/*
-	* 5.2.1 The element information item must be ·valid· with respect 
-	* to the ·actual type definition· as defined by Element Locally 
+	* 5.2.1 The element information item must be ·valid· with respect
+	* to the ·actual type definition· as defined by Element Locally
 	* Valid (Type) (§3.3.4).
-	*/	
+	*/
 	if (WXS_IS_SIMPLE(inode->typeDef)) {
 	     /*
 	    * SPEC (cvc-type) (3.1)
@@ -26135,7 +26135,7 @@
 	    * (Element) (§3.3.4) did not apply, then the ·normalized value·
 	    * must be ·valid· with respect to the type definition as defined
 	    * by String Valid (§3.14.4).
-	    */	    
+	    */
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		    inode, inode->typeDef, inode->value);
 	} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
@@ -26146,14 +26146,14 @@
 	    * Element Locally Valid (Complex Type) (§3.4.4);"
 	    *
 	    * SPEC (cvc-complex-type) (2.2)
-	    * "If the {content type} is a simple type definition, ... 
+	    * "If the {content type} is a simple type definition, ...
 	    * the ·normalized value· of the element information item is
 	    * ·valid· with respect to that simple type definition as
 	    * defined by String Valid (§3.14.4)."
 	    */
 	    ret = xmlSchemaVCheckINodeDataType(vctxt,
 		inode, inode->typeDef->contentTypeDef, inode->value);
-	}	
+	}
 	if (ret != 0) {
 	    if (ret < 0) {
 		VERROR_INT("xmlSchemaValidatorPopElem",
@@ -26163,7 +26163,7 @@
 	    goto end_elem;
 	}
 	/*
-	* 5.2.2 If there is a fixed {value constraint} and clause 3.2 has 
+	* 5.2.2 If there is a fixed {value constraint} and clause 3.2 has
 	* not applied, all of the following must be true:
 	*/
 	if ((inode->decl->value != NULL) &&
@@ -26174,7 +26174,7 @@
 	    * done on computed values.
 	    */
 	    /*
-	    * 5.2.2.1 The element information item must have no element 
+	    * 5.2.2.1 The element information item must have no element
 	    * information item [children].
 	    */
 	    if (inode->flags &
@@ -26186,28 +26186,28 @@
 		goto end_elem;
 	    } else {
 		/*
-		* 5.2.2.2 The appropriate case among the following must 
+		* 5.2.2.2 The appropriate case among the following must
 		* be true:
-		*/		
+		*/
 		if (WXS_HAS_MIXED_CONTENT(inode->typeDef)) {
 		    /*
-		    * 5.2.2.2.1 If the {content type} of the ·actual type 
-		    * definition· is mixed, then the *initial value* of the 
-		    * item must match the canonical lexical representation 
+		    * 5.2.2.2.1 If the {content type} of the ·actual type
+		    * definition· is mixed, then the *initial value* of the
+		    * item must match the canonical lexical representation
 		    * of the {value constraint} value.
 		    *
-		    * ... the *initial value* of an element information 
-		    * item is the string composed of, in order, the 
-		    * [character code] of each character information item in 
+		    * ... the *initial value* of an element information
+		    * item is the string composed of, in order, the
+		    * [character code] of each character information item in
 		    * the [children] of that element information item.
-		    */		   
+		    */
 		    if (! xmlStrEqual(inode->value, inode->decl->value)){
-			/* 
+			/*
 			* VAL TODO: Report invalid & expected values as well.
 			* VAL TODO: Implement the canonical stuff.
 			*/
 			ret = XML_SCHEMAV_CVC_ELT_5_2_2_2_1;
-			xmlSchemaCustomErr(ACTXT_CAST vctxt, 
+			xmlSchemaCustomErr(ACTXT_CAST vctxt,
 			    ret, NULL, NULL,
 			    "The initial value '%s' does not match the fixed "
 			    "value constraint '%s'",
@@ -26216,9 +26216,9 @@
 		    }
 		} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
 		    /*
-		    * 5.2.2.2.2 If the {content type} of the ·actual type 
-		    * definition· is a simple type definition, then the 
-		    * *actual value* of the item must match the canonical 
+		    * 5.2.2.2.2 If the {content type} of the ·actual type
+		    * definition· is a simple type definition, then the
+		    * *actual value* of the item must match the canonical
 		    * lexical representation of the {value constraint} value.
 		    */
 		    /*
@@ -26233,16 +26233,16 @@
 			xmlSchemaCustomErr(ACTXT_CAST vctxt,
 			    ret, NULL, NULL,
 			    "The actual value '%s' does not match the fixed "
-			    "value constraint '%s'", 
+			    "value constraint '%s'",
 			    inode->value,
 			    inode->decl->value);
 			goto end_elem;
-		    }		    
+		    }
 		}
-	    }	    
+	    }
 	}
     }
-    
+
 end_elem:
     if (vctxt->depth < 0) {
 	/* TODO: raise error? */
@@ -26252,7 +26252,7 @@
 	vctxt->skipDepth = -1;
     /*
     * Evaluate the history of XPath state objects.
-    */    
+    */
     if (inode->appliedXPath &&
 	(xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
 	goto internal_error;
@@ -26268,7 +26268,7 @@
     *   We will currently build IDC node-tables and bubble them only if
     *   keyrefs do exist.
     */
-    
+
     /*
     * Add the current IDC target-nodes to the IDC node-tables.
     */
@@ -26302,7 +26302,7 @@
 	    */
 	    if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1)
 		goto internal_error;
-	}	
+	}
     }
     /*
     * Clear the current ielem.
@@ -26335,10 +26335,10 @@
 	    aidc = aidc->next;
 	} while (aidc != NULL);
     }
-    vctxt->depth--;        
+    vctxt->depth--;
     vctxt->inode = vctxt->elemInfos[vctxt->depth];
     /*
-    * VAL TODO: 7 If the element information item is the ·validation root·, it must be 
+    * VAL TODO: 7 If the element information item is the ·validation root·, it must be
     * ·valid· per Validation Root Valid (ID/IDREF) (§3.3.4).
     */
     return (ret);
@@ -26595,7 +26595,7 @@
     if (consumed != NULL)
 	*consumed = 0;
     if (INODE_NILLED(vctxt->inode)) {
-	/* 
+	/*
 	* SPEC cvc-elt (3.3.4 - 3.2.1)
 	* "The element information item must have no character or
 	* element information item [children]."
@@ -26611,7 +26611,7 @@
     * information item [children]."
     */
     if (vctxt->inode->typeDef->contentType ==
-	    XML_SCHEMA_CONTENT_EMPTY) {    
+	    XML_SCHEMA_CONTENT_EMPTY) {
 	VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, NULL,
 	    "Character content is not allowed, "
 	    "because the content type is empty");
@@ -26622,12 +26622,12 @@
 	    XML_SCHEMA_CONTENT_ELEMENTS) {
 	if ((nodeType != XML_TEXT_NODE) ||
 	    (! xmlSchemaIsBlank((xmlChar *) value, len))) {
-	    /* 
-	    * SPEC cvc-complex-type (2.3) 
-	    * "If the {content type} is element-only, then the 
-	    * element information item has no character information 
-	    * item [children] other than those whose [character 
-	    * code] is defined as a white space in [XML 1.0 (Second 
+	    /*
+	    * SPEC cvc-complex-type (2.3)
+	    * "If the {content type} is element-only, then the
+	    * element information item has no character information
+	    * item [children] other than those whose [character
+	    * code] is defined as a white space in [XML 1.0 (Second
 	    * Edition)]."
 	    */
 	    VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, NULL,
@@ -26637,7 +26637,7 @@
 	}
 	return (0);
     }
-    
+
     if ((value == NULL) || (value[0] == 0))
 	return (0);
     /*
@@ -26649,7 +26649,7 @@
 	((vctxt->inode->decl == NULL) ||
 	(vctxt->inode->decl->value == NULL)))
 	return (0);
-    
+
     if (vctxt->inode->value == NULL) {
 	/*
 	* Set the value.
@@ -26692,7 +26692,7 @@
 	    len = xmlStrlen(value);
 	/*
 	* Concat the value.
-	*/	
+	*/
 	if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
 	    vctxt->inode->value = BAD_CAST xmlStrncat(
 		(xmlChar *) vctxt->inode->value, value, len);
@@ -26701,7 +26701,7 @@
 		BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
 	    vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES;
 	}
-    }	
+    }
 
     return (0);
 }
@@ -26718,7 +26718,7 @@
 	goto internal_error;
     }
     if (vctxt->xsiAssemble) {
-	/* 
+	/*
 	* We will stop validation if there was an error during
 	* dynamic schema construction.
 	* Note that we simply set @skipDepth to 0, this could
@@ -26831,12 +26831,12 @@
     	VERROR(ret, NULL,
     	    "The type definition is absent");
 	goto exit;
-    }    
+    }
     if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) {
 	vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
 	ret = XML_SCHEMAV_CVC_TYPE_2;
     	    VERROR(ret, NULL,
-    	    "The type definition is abstract");	
+    	    "The type definition is abstract");
 	goto exit;
     }
     /*
@@ -26917,7 +26917,7 @@
 	nodeType = xmlTextReaderNodeType(vctxt->reader);
 
 	if (nodeType == XML_ELEMENT_NODE) {
-	    
+
 	    vctxt->depth++;
 	    if (xmlSchemaValidatorPushElem(vctxt) == -1) {
 		VERROR_INT("xmlSchemaVReaderWalk",
@@ -27092,8 +27092,8 @@
 * Process text content.
 */
 static void
-xmlSchemaSAXHandleText(void *ctx, 
-		       const xmlChar * ch, 
+xmlSchemaSAXHandleText(void *ctx,
+		       const xmlChar * ch,
 		       int len)
 {
     xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
@@ -27117,10 +27117,10 @@
 * Process CDATA content.
 */
 static void
-xmlSchemaSAXHandleCDataSection(void *ctx, 
-			     const xmlChar * ch, 
+xmlSchemaSAXHandleCDataSection(void *ctx,
+			     const xmlChar * ch,
 			     int len)
-{   
+{
     xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
 
     if (vctxt->depth < 0)
@@ -27154,20 +27154,20 @@
 
 static void
 xmlSchemaSAXHandleStartElementNs(void *ctx,
-				 const xmlChar * localname, 
-				 const xmlChar * prefix ATTRIBUTE_UNUSED, 
-				 const xmlChar * URI, 
-				 int nb_namespaces, 
-				 const xmlChar ** namespaces, 
-				 int nb_attributes, 
-				 int nb_defaulted ATTRIBUTE_UNUSED, 
+				 const xmlChar * localname,
+				 const xmlChar * prefix ATTRIBUTE_UNUSED,
+				 const xmlChar * URI,
+				 int nb_namespaces,
+				 const xmlChar ** namespaces,
+				 int nb_attributes,
+				 int nb_defaulted ATTRIBUTE_UNUSED,
 				 const xmlChar ** attributes)
-{  
+{
     xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
     int ret;
     xmlSchemaNodeInfoPtr ielem;
     int i, j;
-    
+
     /*
     * SAX VAL TODO: What to do with nb_defaulted?
     */
@@ -27195,16 +27195,16 @@
     ielem->flags |= XML_SCHEMA_ELEM_INFO_EMPTY;
     /*
     * Register namespaces on the elem info.
-    */    
+    */
     if (nb_namespaces != 0) {
 	/*
 	* Although the parser builds its own namespace list,
 	* we have no access to it, so we'll use an own one.
 	*/
-        for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {	    
+        for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {
 	    /*
 	    * Store prefix and namespace name.
-	    */	   
+	    */
 	    if (ielem->nsBindings == NULL) {
 		ielem->nsBindings =
 		    (const xmlChar **) xmlMalloc(10 *
@@ -27240,7 +27240,7 @@
 	    } else
 		ielem->nsBindings[ielem->nbNsBindings * 2 + 1] =
 		    namespaces[j+1];
-	    ielem->nbNsBindings++;	    	    
+	    ielem->nbNsBindings++;
 	}
     }
     /*
@@ -27254,7 +27254,7 @@
         for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
 	    /*
 	    * Duplicate the value.
-	    */	 
+	    */
 	    value = xmlStrndup(attributes[j+3],
 		attributes[j+4] - attributes[j+3]);
 	    /*
@@ -27281,7 +27281,7 @@
 	    goto internal_error;
 	}
 	goto exit;
-    }    
+    }
 
 exit:
     return;
@@ -27391,7 +27391,7 @@
 #ifdef LIBXML_READER_ENABLED
     vctxt->reader = NULL;
 #endif
-    vctxt->hasKeyrefs = 0;    
+    vctxt->hasKeyrefs = 0;
 
     if (vctxt->value != NULL) {
         xmlSchemaFreeValue(vctxt->value);
@@ -27461,7 +27461,7 @@
 		break;
 	    xmlSchemaClearElemInfo(vctxt, ei);
 	}
-    }    
+    }
     xmlSchemaItemListClear(vctxt->nodeQNames);
     /* Recreate the dict. */
     xmlDictFree(vctxt->dict);
@@ -27563,7 +27563,7 @@
  * @ctxt: the schema validation context
  *
  * Check if any error was detected during validation.
- * 
+ *
  * Returns 1 if valid so far, 0 if errors were detected, and -1 in case
  *         of internal error.
  */
@@ -27622,7 +27622,7 @@
 
 /**
  * xmlSchemaGetValidErrors:
- * @ctxt:	a XML-Schema validation context
+ * @ctxt: a XML-Schema validation context
  * @err: the error function result
  * @warn: the warning function result
  * @ctx: the functions context result
@@ -27683,7 +27683,7 @@
 
 /**
  * xmlSchemaValidCtxtGetOptions:
- * @ctxt:	a schema validation context
+ * @ctxt: a schema validation context
  *
  * Get the validation context options.
  *
@@ -27751,7 +27751,7 @@
 			nsName = NULL;
 		    ret = xmlSchemaValidatorPushAttribute(vctxt,
 			(xmlNodePtr) attr,
-			/* 
+			/*
 			* Note that we give it the line number of the
 			* parent element.
 			*/
@@ -27807,7 +27807,7 @@
 	    (node->type == XML_ENTITY_REF_NODE)) {
 	    /*
 	    * DOC VAL TODO: What to do with entities?
-	    */	    
+	    */
 	    VERROR_INT("xmlSchemaVDocWalk",
 		"there is at least one entity reference in the node-tree "
 		"currently being validated. Processing of entities with "
@@ -27867,7 +27867,7 @@
 xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
     /*
     * Some initialization.
-    */    
+    */
     vctxt->err = 0;
     vctxt->nberrors = 0;
     vctxt->depth = -1;
@@ -27884,9 +27884,9 @@
     */
     if (vctxt->schema == NULL) {
 	xmlSchemaParserCtxtPtr pctxt;
-	
+
 	vctxt->xsiAssemble = 1;
-	/* 
+	/*
 	* If not schema was given then we will create a schema
 	* dynamically using XSI schema locations.
 	*
@@ -27902,8 +27902,8 @@
 	*/
 	vctxt->schema = xmlSchemaNewSchema(pctxt);
 	if (vctxt->schema == NULL)
-	    return (-1);		
-	/* 
+	    return (-1);
+	/*
 	* Create the schema construction context.
 	*/
 	pctxt->constructor = xmlSchemaConstructionCtxtCreate(pctxt->dict);
@@ -27914,13 +27914,13 @@
 	* Take ownership of the constructor to be able to free it.
 	*/
 	pctxt->ownsConstructor = 1;
-    }	
-    /* 
-    * Augment the IDC definitions for the main schema and all imported ones 
+    }
+    /*
+    * Augment the IDC definitions for the main schema and all imported ones
     * NOTE: main schema if the first in the imported list
     */
     xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
-    
+
     return(0);
 }
 
@@ -28335,10 +28335,10 @@
 }
 
 static void
-startElementNsSplit(void *ctx, const xmlChar * localname, 
-		    const xmlChar * prefix, const xmlChar * URI, 
-		    int nb_namespaces, const xmlChar ** namespaces, 
-		    int nb_attributes, int nb_defaulted, 
+startElementNsSplit(void *ctx, const xmlChar * localname,
+		    const xmlChar * prefix, const xmlChar * URI,
+		    int nb_namespaces, const xmlChar ** namespaces,
+		    int nb_attributes, int nb_defaulted,
 		    const xmlChar ** attributes) {
     xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
     if (ctxt == NULL)
@@ -28357,7 +28357,7 @@
 }
 
 static void
-endElementNsSplit(void *ctx, const xmlChar * localname, 
+endElementNsSplit(void *ctx, const xmlChar * localname,
 		    const xmlChar * prefix, const xmlChar * URI) {
     xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
     if (ctxt == NULL)
@@ -28398,7 +28398,7 @@
     old_sax = *sax;
     if ((old_sax != NULL) && (old_sax->initialized != XML_SAX2_MAGIC))
         return(NULL);
-    if ((old_sax != NULL) && 
+    if ((old_sax != NULL) &&
         (old_sax->startElementNs == NULL) && (old_sax->endElementNs == NULL) &&
         ((old_sax->startElement != NULL) || (old_sax->endElement != NULL)))
         return(NULL);
@@ -28416,7 +28416,7 @@
     ret->ctxt = ctxt;
     ret->user_sax_ptr = sax;
     ret->user_sax = old_sax;
-    if (old_sax == NULL) {	
+    if (old_sax == NULL) {
         /*
 	 * go direct, no need for the split block and functions.
 	 */
@@ -28437,7 +28437,7 @@
     } else {
        /*
         * for each callback unused by Schemas initialize it to the Split
-	* routine only if non NULL in the user block, this can speed up 
+	* routine only if non NULL in the user block, this can speed up
 	* things at the SAX level.
 	*/
         if (old_sax->internalSubset != NULL)
@@ -28590,7 +28590,7 @@
     if (options)
         xmlCtxtUseOptions(pctxt, options);
 #endif
-    pctxt->linenumbers = 1;    
+    pctxt->linenumbers = 1;
 
     inputStream = xmlNewIOInputStream(pctxt, input, enc);;
     if (inputStream == NULL) {
@@ -28658,16 +28658,33 @@
 
     if ((ctxt == NULL) || (filename == NULL))
         return (-1);
-    
+
     input = xmlParserInputBufferCreateFilename(filename,
 	XML_CHAR_ENCODING_NONE);
     if (input == NULL)
 	return (-1);
     ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
-	NULL, NULL);    
+	NULL, NULL);
     return (ret);
 }
 
+/**
+ * xmlSchemaValidCtxtGetParserCtxt:
+ * @ctxt: a schema validation context
+ *
+ * allow access to the parser context of the schema validation context
+ *
+ * Returns the parser context of the schema validation context or NULL
+ *         in case of error.
+ */
+xmlParserCtxtPtr
+xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt)
+{
+    if (ctxt == NULL)
+        return(NULL);
+    return (ctxt->parserCtxt);
+}
+
 #define bottom_xmlschemas
 #include "elfgcchack.h"
 #endif /* LIBXML_SCHEMAS_ENABLED */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]