diff --git a/ChangeLog b/ChangeLog index 576509ad..0ceee43a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Fri Apr 11 14:44:00 CEST 2008 Daniel Veillard + + * 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 + + Thu Apr 10 10:07:00 CEST 2008 Daniel Veillard * Makefile.am: extend the cleanup rule diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html index 8ccc8a6f..2f8eead2 100644 --- a/doc/APIconstructors.html +++ b/doc/APIconstructors.html @@ -447,6 +447,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCreatePushParserCtxt
xmlCreateURLParserCtxt
xmlNewParserCtxt
+xmlSchemaValidCtxtGetParserCtxt

Type xmlParserErrors:

xmlParseInNodeContext

Type xmlParserInputBufferCreateFilenameFunc:

xmlParserInputBufferCreateFilenameDefault
xmlThrDefParserInputBufferCreateFilenameDefault
diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 30d650a4..bf36bed2 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -2849,6 +2849,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaSetValidStructuredErrors
xmlSchemaValidCtxt
xmlSchemaValidCtxtGetOptions
+xmlSchemaValidCtxtGetParserCtxt
xmlSchemaValidCtxtPtr
xmlSchemaValidError
xmlSchemaValidOption
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 9e83889f..4f460092 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -1934,6 +1934,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaSetValidOptions
xmlSchemaSetValidStructuredErrors
xmlSchemaValidCtxtGetOptions
+xmlSchemaValidCtxtGetParserCtxt
xmlSchemaValidateDoc
xmlSchemaValidateFile
xmlSchemaValidateOneElement
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index af09644c..35e5d102 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -2747,6 +2747,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaValType
xmlSchemaValidCtxt
xmlSchemaValidCtxtGetOptions
+xmlSchemaValidCtxtGetParserCtxt
xmlSchemaValidCtxtPtr
xmlSchemaValidError
xmlSchemaValidOption
diff --git a/doc/apibuild.py b/doc/apibuild.py index 1e737250..505a0bc3 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -356,7 +356,7 @@ class index: 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 @@ class CLexer: else: line = line + n return line - + def getlineno(self): return self.lineno @@ -557,12 +557,12 @@ class CLexer: 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 @@ class CParser: l = string.strip(l) desc = desc + " " + l del lines[0] - + desc = string.strip(desc) if quiet == 0: @@ -787,7 +787,7 @@ class CParser: l = string.strip(l) desc = desc + " " + l del lines[0] - + desc = string.strip(desc) if quiet == 0: @@ -888,7 +888,7 @@ class CParser: else: desc = desc + " " + l del lines[0] - + retdesc = string.strip(retdesc) desc = string.strip(desc) @@ -898,7 +898,8 @@ class CParser: # 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: 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 @@ class CParser: token = self.token() else: break - + return token def parse(self): @@ -1590,7 +1590,7 @@ class CParser: return self.parseTopComment(self.top_comment) return self.index - + class docBuilder: """A documentation builder""" @@ -1687,7 +1687,7 @@ class docBuilder: 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 @@ class docBuilder: else: output.write(" \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 @@ class docBuilder: output.write(" %s\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(" %s\n" % (escape(desc))) self.indexString(name, desc) if ret[0] != None: diff --git a/doc/devhelp/libxml2-c14n.html b/doc/devhelp/libxml2-c14n.html index 72f53b65..e60f229f 100644 --- a/doc/devhelp/libxml2-c14n.html +++ b/doc/devhelp/libxml2-c14n.html @@ -57,8 +57,8 @@ int xmlC14NDocDumpMemory (

+

Signature for a C14N callback on visible nodes

+
user_data:user data
node:the curent node
parent:the parent node
Returns:1 if the node should be included

xmlC14NDocDumpMemory ()

int	xmlC14NDocDumpMemory		(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int exclusive,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlChar ** doc_txt_ptr)

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)

diff --git a/doc/devhelp/libxml2-globals.html b/doc/devhelp/libxml2-globals.html index c7f396ea..449049ef 100644 --- a/doc/devhelp/libxml2-globals.html +++ b/doc/devhelp/libxml2-globals.html @@ -125,20 +125,20 @@ const char * xmlThrDefTreeIndentString

+

Signature for the deregistration callback of a discarded node

+
node:the current node

Function type xmlOutputBufferCreateFilenameFunc

xmlOutputBufferPtr	xmlOutputBufferCreateFilenameFunc	(const char * URI, 
xmlCharEncodingHandlerPtr encoder,
int compression)
-

-

URI:
encoder:
compression:
Returns:
+

Signature for the function doing the lookup for a suitable output method corresponding to an URI.

+
URI:the URI to write to
encoder:
compression:
Returns:the new xmlOutputBufferPtr in case of success or NULL if no method was found.

Function type xmlParserInputBufferCreateFilenameFunc

xmlParserInputBufferPtr	xmlParserInputBufferCreateFilenameFunc	(const char * URI, 
xmlCharEncoding enc)
-

-

URI:
enc:
Returns:
+

Signature for the function doing the lookup for a suitable input method corresponding to an URI.

+
URI:the URI to read from
enc:the requested source encoding
Returns:the new xmlParserInputBufferPtr in case of success or NULL if no method was found.

+

Signature for the registration callback of a created node

+
node:the current node

Variable docbDefaultSAXHandler

xmlSAXHandlerV1 docbDefaultSAXHandler;
 

diff --git a/doc/devhelp/libxml2-relaxng.html b/doc/devhelp/libxml2-relaxng.html index d7da3e54..a89b58ff 100644 --- a/doc/devhelp/libxml2-relaxng.html +++ b/doc/devhelp/libxml2-relaxng.html @@ -169,12 +169,12 @@ The content of this structure is not made public by the API.


+

Signature of an error callback from a Relax-NG validation

+
ctx:the validation context
msg:the message
...:extra arguments

+

Signature of a warning callback from a Relax-NG validation

+
ctx:the validation context
msg:the message
...:extra arguments


+

Signature of an error callback from a Schematron validation

+
ctx:the validation context
msg:the message
...:extra arguments

+

Signature of a warning callback from a Schematron validation

+
ctx:the validation context
msg:the message
...:extra arguments

xmlSchematronFree ()

void	xmlSchematronFree		(xmlSchematronPtr schema)

Deallocate a Schematron structure.

diff --git a/doc/devhelp/libxml2-xmlreader.html b/doc/devhelp/libxml2-xmlreader.html index 1609a963..2466e752 100644 --- a/doc/devhelp/libxml2-xmlreader.html +++ b/doc/devhelp/libxml2-xmlreader.html @@ -211,8 +211,8 @@ The content of this structure is not made public by the API.

+

Signature of an error callback from a reader parser

+
arg:the user argument
msg:the message
severity:the severity of the error
locator:a locator indicating where the error occured

xmlFreeTextReader ()

void	xmlFreeTextReader		(xmlTextReaderPtr reader)

Deallocate all the resources associated to the reader

diff --git a/doc/devhelp/libxml2-xmlregexp.html b/doc/devhelp/libxml2-xmlregexp.html index e7836484..4d119667 100644 --- a/doc/devhelp/libxml2-xmlregexp.html +++ b/doc/devhelp/libxml2-xmlregexp.html @@ -143,8 +143,8 @@ The content of this structure is not made public by the API.

Function type xmlRegExecCallbacks

void	xmlRegExecCallbacks		(xmlRegExecCtxtPtr exec, 
const xmlChar * token,
void * transdata,
void * inputdata)
-

-

exec:
token:
transdata:
inputdata:
+

Callback function when doing a transition in the automata

+
exec:the regular expression context
token:the current token string
transdata:transition data
inputdata:input data

Variable emptyExp

xmlExpNodePtr emptyExp;
 

diff --git a/doc/devhelp/libxml2-xmlschemas.html b/doc/devhelp/libxml2-xmlschemas.html index 4801ea5d..cc49dfae 100644 --- a/doc/devhelp/libxml2-xmlschemas.html +++ b/doc/devhelp/libxml2-xmlschemas.html @@ -68,7 +68,7 @@ void xmlSchemaSetValidStructuredErr void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx); int xmlSchemaValidCtxtGetOptions (xmlSchemaValidCtxtPtr ctxt); int xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
const char * filename,
int options); -int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr instance); +int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr doc); void xmlSchemaFree (xmlSchemaPtr schema); xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt (const char * buffer,
int size); int xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void ** ctx); @@ -77,6 +77,7 @@ void xmlSchemaSetParserErrors (xmlSchemaValidityWarningFunc (void * ctx,
const char * msg,
... ...); void xmlSchemaDump (FILE * output,
xmlSchemaPtr schema); void xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); +xmlParserCtxtPtr xmlSchemaValidCtxtGetParserCtxt (xmlSchemaValidCtxtPtr ctxt); void xmlSchemaSetParserStructuredErrors (xmlSchemaParserCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx); xmlSchemaValidCtxtPtr xmlSchemaNewValidCtxt (xmlSchemaPtr schema); @@ -185,12 +186,12 @@ The content of this structure is not made public by the API.


+

Signature of an error callback from an XSD validation

+
ctx:the validation context
msg:the message
...:extra arguments

+

Signature of a warning callback from an XSD validation

+
ctx:the validation context
msg:the message
...:extra arguments

xmlSchemaDump ()

void	xmlSchemaDump			(FILE * output, 
xmlSchemaPtr schema)

Dump a Schema structure.

@@ -205,20 +206,20 @@ The content of this structure is not made public by the API.
ctxt:the schema parser context

+

Free the resources associated to the schema validation context

+
ctxt:the schema validation context

xmlSchemaGetParserErrors ()

int	xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void ** ctx)

Get the callback information used to handle errors for a parser context

ctxt:a XMl-Schema parser context
err:the error callback result
warn:the warning callback result
ctx:contextual data for the callbacks result
Returns:-1 in case of failure, 0 otherwise

+

Get the error and warning callback informations

+
ctxt:a XML-Schema validation context
err:the error function result
warn:the warning function result
ctx:the functions context result
Returns:-1 in case of error and 0 otherwise

+

Check if any error was detected during validation.

+
ctxt:the schema validation context
Returns:1 if valid so far, 0 if errors were detected, and -1 in case of internal error.

xmlSchemaNewDocParserCtxt ()

xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc)

Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.

@@ -233,20 +234,20 @@ The content of this structure is not made public by the API.
URL:the location of the schema
Returns:the parser context or NULL in case of error

xmlSchemaNewValidCtxt ()

xmlSchemaValidCtxtPtr	xmlSchemaNewValidCtxt	(xmlSchemaPtr schema)
-

-

schema:
Returns:
+

Create an XML Schemas validation context based on the given schema.

+
schema:a precompiled XML Schemas
Returns:the validation context or NULL in case of error

xmlSchemaParse ()

xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt)

parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

ctxt:a schema validation context
Returns:the internal XML Schema structure built from the resource or NULL in case of error

xmlSchemaSAXPlug ()

xmlSchemaSAXPlugPtr	xmlSchemaSAXPlug	(xmlSchemaValidCtxtPtr ctxt, 
xmlSAXHandlerPtr * sax,
void ** user_data)
-

-

ctxt:
sax:
user_data:
Returns:
+

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.

+
ctxt:a schema validation context
sax:a pointer to the original xmlSAXHandlerPtr
user_data:a pointer to the original SAX user data pointer
Returns:a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.

+

Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.

+
plug:a data structure returned by xmlSchemaSAXPlug
Returns:0 in case of success and -1 in case of failure.

xmlSchemaSetParserErrors ()

void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx)

Set the callback functions used to handle errors for a validation context

@@ -257,36 +258,40 @@ The content of this structure is not made public by the API.
ctxt:a schema parser context
serror:the structured error function
ctx:the functions context

+

Set the error and warning callback informations

+
ctxt:a schema validation context
err:the error function
warn:the warning function
ctx:the functions context

+

Sets the options to be used during the validation.

+
ctxt:a schema validation context
options:a combination of xmlSchemaValidOption
Returns:0 in case of success, -1 in case of an API error.

+

Set the structured error callback

+
ctxt:a schema validation context
serror:the structured error function
ctx:the functions context

+

Get the validation context options.

+
ctxt:a schema validation context
Returns:the option combination or -1 on error.

- +

xmlSchemaValidCtxtGetParserCtxt ()

xmlParserCtxtPtr	xmlSchemaValidCtxtGetParserCtxt	(xmlSchemaValidCtxtPtr ctxt)
+

allow access to the parser context of the schema validation context

+
ctxt:a schema validation context
Returns:the parser context of the schema validation context or NULL in case of error.
+
+

xmlSchemaValidateDoc ()

int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
xmlDocPtr doc)
+

Validate a document tree in memory.

+
ctxt:a schema validation context
doc:a parsed document tree
Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.

xmlSchemaValidateFile ()

int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
const char * filename,
int options)
-

-

ctxt:
filename:
options:
Returns:
+

Do a schemas validation of the given resource, it will use the SAX streamable validation internally.

+
ctxt:a schema validation context
filename:the URI of the instance
options:a future set of options, currently unused
Returns:0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.

+

Validate a branch of a tree, starting with the given @elem.

+
ctxt:a schema validation context
elem:an element node
Returns: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.

+

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.

+
ctxt:a schema validation context
input:the input to use for reading the data
enc:an optional encoding information
sax:a SAX handler for the resulting events
user_data:the context to provide to the SAX handler.
Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.

diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp index 499bcb9a..4466b4da 100644 --- a/doc/devhelp/libxml2.devhelp +++ b/doc/devhelp/libxml2.devhelp @@ -2835,6 +2835,7 @@ + diff --git a/doc/html/libxml-xmlschemas.html b/doc/html/libxml-xmlschemas.html index 261f2210..1943f205 100644 --- a/doc/html/libxml-xmlschemas.html +++ b/doc/html/libxml-xmlschemas.html @@ -43,6 +43,7 @@ The content of this structure is not made public by the API.
int	xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt, 
int options)
void	xmlSchemaSetValidStructuredErrors	(xmlSchemaValidCtxtPtr ctxt, 
xmlStructuredErrorFunc serror,
void * ctx)
int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)
+
xmlParserCtxtPtr	xmlSchemaValidCtxtGetParserCtxt	(xmlSchemaValidCtxtPtr ctxt)
int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
xmlDocPtr instance)
int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
const char * filename,
int options)
int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
xmlNodePtr elem)
@@ -153,6 +154,8 @@ The content of this structure is not made public by the API.

ctxt:
serror:
ctx:

Function: xmlSchemaValidCtxtGetOptions

int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)

+
ctxt:
Returns:

Function: xmlSchemaValidCtxtGetParserCtxt

xmlParserCtxtPtr	xmlSchemaValidCtxtGetParserCtxt	(xmlSchemaValidCtxtPtr ctxt)
+

ctxt:
Returns:

Function: xmlSchemaValidateDoc

int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
xmlDocPtr instance)

ctxt:
instance:
Returns:

Function: xmlSchemaValidateFile

int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
const char * filename,
int options)
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 867ac92f..d62c5a6e 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -3046,6 +3046,7 @@ + @@ -8552,11 +8553,11 @@ Could we use @subtypes for this?'/> defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - - - - - + Signature for a C14N callback on visible nodes + + + + Constructs a canonic path from the specified path. @@ -9247,9 +9248,9 @@ Could we use @subtypes for this?'/> - + Signature for the deregistration callback of a discarded node - + 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. @@ -11628,9 +11629,9 @@ Could we use @subtypes for this?'/> - - - + Signature for the function doing the lookup for a suitable output method corresponding to an URI. + + @@ -12143,10 +12144,10 @@ Could we use @subtypes for this?'/> - - - - + Signature for the function doing the lookup for a suitable input method corresponding to an URI. + + + Create a buffered parser input for the progressive parsing for the input from an I/O handler @@ -12525,12 +12526,12 @@ Could we use @subtypes for this?'/> defined(LIBXML_REGEXP_ENABLED) - + Callback function when doing a transition in the automata - - - - + + + + defined(LIBXML_REGEXP_ENABLED) @@ -12649,9 +12650,9 @@ Could we use @subtypes for this?'/> - + Signature for the registration callback of a created node - + defined(LIBXML_OUTPUT_ENABLED) @@ -12828,19 +12829,19 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - + Signature of an error callback from a Relax-NG validation - - - + + + defined(LIBXML_SCHEMAS_ENABLED) - + Signature of a warning callback from a Relax-NG validation - - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13405,9 +13406,9 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - + Free the resources associated to the schema validation context - + defined(LIBXML_SCHEMAS_ENABLED) @@ -13478,12 +13479,12 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - - - - + Get the error and warning callback informations + + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13499,9 +13500,9 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - + Check if any error was detected during validation. + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13550,9 +13551,9 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - + Create an XML Schemas validation context based on the given schema. + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13562,17 +13563,17 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - - - + 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. + + + + defined(LIBXML_SCHEMAS_ENABLED) - - - + Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored. + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13593,27 +13594,27 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - + Set the error and warning callback informations - - - - + + + + defined(LIBXML_SCHEMAS_ENABLED) - - - - + Sets the options to be used during the validation. + + + defined(LIBXML_SCHEMAS_ENABLED) - + Set the structured error callback - - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13635,16 +13636,22 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - + Get the validation context options. + + + + + defined(LIBXML_SCHEMAS_ENABLED) + allow access to the parser context of the schema validation context + + defined(LIBXML_SCHEMAS_ENABLED) - - - - + Validate a document tree in memory. + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13668,11 +13675,11 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - - - + Do a schemas validation of the given resource, it will use the SAX streamable validation internally. + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13706,10 +13713,10 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - - + Validate a branch of a tree, starting with the given @elem. + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13721,29 +13728,29 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMAS_ENABLED) - - - - - - - + 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. + + + + + + defined(LIBXML_SCHEMAS_ENABLED) - + Signature of an error callback from an XSD validation - - - + + + defined(LIBXML_SCHEMAS_ENABLED) - + Signature of a warning callback from an XSD validation - - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13843,19 +13850,19 @@ Could we use @subtypes for this?'/> defined(LIBXML_SCHEMATRON_ENABLED) - + Signature of an error callback from a Schematron validation - - - + + + defined(LIBXML_SCHEMATRON_ENABLED) - + Signature of a warning callback from a Schematron validation - - - + + + 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't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case. @@ -14486,12 +14493,12 @@ Could we use @subtypes for this?'/> defined(LIBXML_READER_ENABLED) - + Signature of an error callback from a reader parser - - - - + + + + defined(LIBXML_READER_ENABLED) diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index de22eec3..e42f4e75 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -2741,6 +2741,7 @@ + @@ -6294,6 +6295,7 @@ + @@ -7612,6 +7614,7 @@ + @@ -10070,6 +10073,7 @@ + @@ -13419,6 +13423,7 @@ + @@ -14485,6 +14490,7 @@ + @@ -14594,6 +14600,7 @@ + @@ -16751,6 +16758,9 @@ + + + @@ -17125,6 +17135,8 @@ + + @@ -17257,6 +17269,7 @@ + @@ -17354,12 +17367,15 @@ + + + @@ -17431,6 +17447,7 @@ + @@ -17480,12 +17497,24 @@ + + + + + + + + + + + + @@ -17914,6 +17943,9 @@ + + + @@ -17988,6 +18020,9 @@ + + + @@ -18174,6 +18209,9 @@ + + + @@ -18297,6 +18335,8 @@ + + @@ -18452,6 +18492,7 @@ + @@ -18769,6 +18810,7 @@ + @@ -19243,6 +19285,10 @@ + + + + @@ -19439,6 +19485,7 @@ + @@ -19584,6 +19631,7 @@ + @@ -20638,6 +20686,8 @@ + + @@ -20757,6 +20807,9 @@ + + + @@ -20764,6 +20817,7 @@ + @@ -21062,6 +21116,7 @@ + @@ -21210,6 +21265,7 @@ + @@ -21369,6 +21425,9 @@ + + + @@ -21461,6 +21520,11 @@ + + + + + @@ -21567,7 +21631,9 @@ + + @@ -22005,8 +22071,14 @@ + + + + + + @@ -22274,6 +22346,7 @@ + @@ -22478,6 +22551,9 @@ + + + @@ -22596,6 +22672,9 @@ + + + @@ -22707,8 +22786,11 @@ + + + @@ -22726,6 +22808,7 @@ + @@ -23335,6 +23418,7 @@ + @@ -23461,6 +23545,7 @@ + @@ -23536,6 +23621,7 @@ + @@ -23562,6 +23648,8 @@ + + @@ -23789,6 +23877,7 @@ + @@ -24018,6 +24107,8 @@ + + @@ -24314,6 +24405,7 @@ + @@ -24419,6 +24511,7 @@ + @@ -24643,22 +24736,6 @@ - - - - - - - - - - - - - - - - @@ -24676,6 +24753,8 @@ + + @@ -24992,6 +25071,7 @@ + @@ -25348,6 +25428,7 @@ + @@ -25572,6 +25653,7 @@ + @@ -25582,6 +25664,9 @@ + + + @@ -25625,6 +25710,8 @@ + + @@ -25962,6 +26049,8 @@ + + @@ -26003,37 +26092,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -26111,6 +26169,7 @@ + @@ -26455,6 +26514,7 @@ + @@ -26663,6 +26723,7 @@ + @@ -26936,9 +26997,11 @@ + + @@ -27087,6 +27150,7 @@ + @@ -27160,6 +27224,7 @@ + @@ -27247,6 +27312,7 @@ + @@ -27273,6 +27339,7 @@ + @@ -27560,8 +27627,11 @@ + + + @@ -27769,6 +27839,9 @@ + + + @@ -28030,6 +28103,7 @@ + @@ -28220,6 +28294,7 @@ + @@ -28364,6 +28439,7 @@ + @@ -28443,6 +28519,7 @@ + @@ -28571,6 +28648,7 @@ + @@ -28661,6 +28739,8 @@ + + @@ -28990,6 +29070,7 @@ + @@ -29419,6 +29500,9 @@ + + + @@ -29468,6 +29552,7 @@ + @@ -29658,6 +29743,7 @@ + @@ -29702,9 +29788,14 @@ + + + + + @@ -29773,6 +29864,7 @@ + @@ -29807,6 +29899,7 @@ + @@ -29984,6 +30077,7 @@ + @@ -30593,6 +30687,7 @@ + @@ -30655,6 +30750,7 @@ + @@ -30817,6 +30913,9 @@ + + + @@ -30826,9 +30925,15 @@ + + + + + + diff --git a/elfgcchack.h b/elfgcchack.h index e1d21bb2..a747fca3 100644 --- a/elfgcchack.h +++ b/elfgcchack.h @@ -9841,6 +9841,18 @@ extern __typeof (xmlSchemaValidCtxtGetOptions) xmlSchemaValidCtxtGetOptions__int #endif #endif +#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 diff --git a/include/libxml/c14n.h b/include/libxml/c14n.h index 9f4c6c01..a8aa737e 100644 --- a/include/libxml/c14n.h +++ b/include/libxml/c14n.h @@ -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 */ #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 #include -#include +#include /* * XML Canonicazation @@ -37,28 +37,28 @@ extern "C" { * 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 @@ XMLPUBFUN int XMLCALL 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 @@ XMLPUBFUN int XMLCALL xmlNodeSetPtr nodes, int exclusive, xmlChar **inclusive_ns_prefixes, - int with_comments, + int with_comments, const char* filename, int compression); @@ -82,17 +82,27 @@ XMLPUBFUN int XMLCALL /** * 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 diff --git a/include/libxml/globals.h b/include/libxml/globals.h index 1173a8f1..57e25fa5 100644 --- a/include/libxml/globals.h +++ b/include/libxml/globals.h @@ -28,8 +28,32 @@ extern "C" { 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 @@ XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc #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 @@ struct _xmlGlobalState int xmlIndentTreeOutput; const char *xmlTreeIndentString; - xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; - xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; + xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; + xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; xmlMallocFunc xmlMallocAtomic; xmlError xmlLastError; @@ -143,9 +179,9 @@ XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNo 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 */ diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h index 6acd4674..29c91c73 100644 --- a/include/libxml/relaxng.h +++ b/include/libxml/relaxng.h @@ -25,11 +25,28 @@ typedef xmlRelaxNG *xmlRelaxNGPtr; /** - * 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; diff --git a/include/libxml/schematron.h b/include/libxml/schematron.h index 9e36c0e8..f442826c 100644 --- a/include/libxml/schematron.h +++ b/include/libxml/schematron.h @@ -38,11 +38,28 @@ typedef struct _xmlSchematron xmlSchematron; 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; diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h index dfe51a3b..f45d377e 100644 --- a/include/libxml/xmlreader.h +++ b/include/libxml/xmlreader.h @@ -42,7 +42,7 @@ typedef enum { * 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 @@ typedef xmlTextReader *xmlTextReaderPtr; 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 @@ XMLPUBFUN int XMLCALL /* * 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 @@ XMLPUBFUN const xmlChar * XMLCALL /* * 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 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 @@ XMLPUBFUN int XMLCALL * 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 diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h index 022cd6a9..7009645a 100644 --- a/include/libxml/xmlregexp.h +++ b/include/libxml/xmlregexp.h @@ -38,7 +38,7 @@ typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; #ifdef __cplusplus } -#endif +#endif #include #include #ifdef __cplusplus @@ -51,16 +51,22 @@ extern "C" { 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 @@ typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, /* * 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 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 @@ typedef enum { } 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 @@ XMLPUBFUN void XMLCALL #endif /* LIBXML_EXPR_ENABLED */ #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_REGEXP_ENABLED */ diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h index 15faef58..556ef89e 100644 --- a/include/libxml/xmlschemas.h +++ b/include/libxml/xmlschemas.h @@ -56,7 +56,7 @@ typedef enum { /* * 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 struct _xmlSchema xmlSchema; 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 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; /* * 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 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 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 @@ XMLPUBFUN int XMLCALL 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; diff --git a/python/libxml2class.txt b/python/libxml2class.txt index 36e273d9..99b68197 100644 --- a/python/libxml2class.txt +++ b/python/libxml2class.txt @@ -1140,6 +1140,7 @@ Class SchemaValidCtxt(SchemaValidCtxtCore) schemaIsValid() schemaSetValidOptions() schemaValidCtxtGetOptions() + schemaValidCtxtGetParserCtxt() schemaValidateDoc() schemaValidateFile() schemaValidateOneElement() diff --git a/testapi.c b/testapi.c index 8a50e888..34705c99 100644 --- a/testapi.c +++ b/testapi.c @@ -34115,6 +34115,40 @@ test_xmlSchemaValidCtxtGetOptions(void) { } +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 @@ static int 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_xmlschemas(void) { 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(); diff --git a/threads.c b/threads.c index 6481b403..12b1eec6 100644 --- a/threads.c +++ b/threads.c @@ -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. * diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src index db05ad46..f4c2c63f 100644 --- a/win32/libxml2.def.src +++ b/win32/libxml2.def.src @@ -1732,6 +1732,9 @@ xmlSchemaValPredefTypeNodeNoNorm xmlSchemaValidCtxtGetOptions #endif #ifdef LIBXML_SCHEMAS_ENABLED +xmlSchemaValidCtxtGetParserCtxt +#endif +#ifdef LIBXML_SCHEMAS_ENABLED xmlSchemaValidateDoc #endif #ifdef LIBXML_SCHEMAS_ENABLED diff --git a/xmlschemas.c b/xmlschemas.c index f2d49f18..a0d0d727 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -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 @@ typedef xmlSchemaBucket *xmlSchemaBucketPtr; #define XML_SCHEMA_SCHEMA_REDEFINE 3 /** - * xmlSchemaSchemaRelation: + * xmlSchemaSchemaRelation: * * Used to create a graph of schema relationships. */ @@ -402,12 +402,12 @@ struct _xmlSchemaBucket { 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 @@ struct _xmlSchemaImport { 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 @@ struct _xmlSchemaInclude { 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 @@ struct _xmlSchemaAttributeUse { 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 @@ struct _xmlSchemaConstructionCtxt { 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 @@ struct _xmlSchemaParserCtxt { 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 @@ struct _xmlSchemaPSVIIDCNode { xmlNodePtr node; xmlSchemaPSVIIDCKeyPtr *keys; int nodeLine; - int nodeQNameID; + int nodeQNameID; }; @@ -879,7 +879,7 @@ struct _xmlSchemaIDCMatcher { struct _xmlSchemaNodeInfo { int nodeType; xmlNodePtr node; - int nodeLine; + int nodeLine; const xmlChar *localName; const xmlChar *nsName; const xmlChar *value; @@ -901,7 +901,7 @@ struct _xmlSchemaNodeInfo { 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 @@ typedef xmlSchemaAttrInfo *xmlSchemaAttrInfoPtr; struct _xmlSchemaAttrInfo { int nodeType; xmlNodePtr node; - int nodeLine; + int nodeLine; const xmlChar *localName; const xmlChar *nsName; const xmlChar *value; @@ -1172,7 +1172,7 @@ xmlSchemaGetComponentTypeStr(xmlSchemaBasicItemPtr item) 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 @@ xmlSchemaFormatQName(xmlChar **buf, *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 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val, 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 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val, if (value2 != NULL) value = value2; } - break; + break; default: if (xmlSchemaGetCanonValue(val, &value2) == -1) { if (value2 != NULL) @@ -1540,29 +1540,29 @@ internal_error: * @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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, default: named = 0; } - } else + } else named = 0; if ((named == 0) && (itemNode != NULL)) { @@ -1740,7 +1740,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, } 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 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, BAD_CAST "'"); } FREE_AND_NULL(str) - + return (*buf); } @@ -1786,13 +1786,13 @@ xmlSchemaFormatFacetEnumSet(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt, * @msg: the error message * @str1: extra data * @str2: extra data - * + * * Handle a parser error */ static void @@ -1914,7 +1914,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, * @msg: the error message * @str1: extra data * @str2: extra data - * + * * Handle a parser error */ static void @@ -1933,7 +1933,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, * 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 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, * @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 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, } __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 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node, * @str1: extra data * @str2: extra data * @str3: extra data - * + * * Handle a validation error */ static void @@ -2028,8 +2028,8 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, { 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 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, if (errorLevel != XML_ERR_WARNING) { vctxt->nberrors++; vctxt->err = error; - channel = vctxt->error; + channel = vctxt->error; } else { channel = vctxt->warning; } @@ -2077,7 +2077,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, 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 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, if (errorLevel != XML_ERR_WARNING) { pctxt->nberrors++; pctxt->err = error; - channel = pctxt->error; + channel = pctxt->error; } else { channel = pctxt->warning; } @@ -2115,11 +2115,11 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, * @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 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt, } 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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, (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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, */ 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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, 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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, 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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, 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 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, 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 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt, } 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 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, const xmlChar *str2) { xmlSchemaCustomErr4(actxt, error, node, item, - message, str1, str2, NULL, NULL); + message, str1, str2, NULL, NULL); } @@ -2344,8 +2344,8 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, } 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 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, * Get the local name. */ localName = NULL; - + end = cur; if (*end == '*') { localName = xmlStrdup(BAD_CAST "*"); @@ -2556,8 +2556,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, } 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 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, /* * 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 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, "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 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, * @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 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaItemListAddSize(xmlSchemaItemListPtr list, static int xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx) -{ +{ if (list->items == NULL) { list->items = (void **) xmlMalloc( 20 * sizeof(void *)); @@ -3412,7 +3412,7 @@ xmlSchemaItemListInsertSize(xmlSchemaItemListPtr list, int initialSize, void *item, int idx) -{ +{ if (list->items == NULL) { if (initialSize <= 0) initialSize = 1; @@ -3467,7 +3467,7 @@ xmlSchemaItemListRemove(xmlSchemaItemListPtr list, int idx) 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 @@ xmlSchemaBucketFree(xmlSchemaBucketPtr bucket) } 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 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, */ 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 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, } WXS_IMPBUCKET(ret)->schema->targetNamespace = targetNamespace; } - } + } if (WXS_IS_BUCKET_IMPMAIN(type)) { int res; /* @@ -3643,11 +3643,11 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list) 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 @@ xmlSchemaFree(xmlSchemaPtr schema) 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 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept /** * xmlSchemaAttrUsesDump: * @uses: attribute uses list - * @output: the file output + * @output: the file output * * Dumps a list of attribute use components. */ @@ -4347,7 +4347,7 @@ xmlSchemaAttrUsesDump(xmlSchemaItemListPtr uses, FILE * output) 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 @@ xmlSchemaDebugDumpIDCTable(FILE * output, 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 @@ xmlSchemaGetPropNodeNs(xmlNodePtr node, const char *uri, const char *name) 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 @@ xmlSchemaGetElem(xmlSchemaPtr schema, const xmlChar * name, 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 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name, 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 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name, } if (schema != NULL) { WXS_FIND_GLOBAL_ITEM(typeDecl) - } + } exit: #ifdef DEBUG @@ -4891,7 +4891,7 @@ xmlSchemaGetGroup(xmlSchemaPtr schema, const xmlChar * name, WXS_FIND_GLOBAL_ITEM(groupDecl) } exit: - + #ifdef DEBUG if (ret == NULL) { if (nsName == NULL) @@ -5000,7 +5000,7 @@ xmlSchemaIsBlank(xmlChar * str, int len) str++; len--; } - + return (1); } @@ -5061,7 +5061,7 @@ xmlSchemaFindRedefCompInGraph(xmlSchemaBucketPtr bucket, default: /* Should not be hit. */ return(NULL); - } + } } } subschemas: @@ -5209,7 +5209,7 @@ xmlSchemaAddAttributeUse(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, if (pctxt->redef == NULL) { xmlFree(ret); return(NULL); - } + } pctxt->redefCounter = 0; } WXS_ADD_GLOBAL(pctxt, ret); @@ -5371,13 +5371,13 @@ xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, if (ctxt->redef == NULL) { xmlFree(ret); return(NULL); - } + } ctxt->redefCounter = 0; } WXS_ADD_GLOBAL(ctxt, ret); @@ -5595,7 +5595,7 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } 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 @@ xmlSchemaSubstGroupAdd(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaCheckReference(xmlSchemaParserCtxtPtr pctxt, * @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 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt, /* * Evaluate the target namespace */ - hasForm = 1; + hasForm = 1; attrValue = xmlSchemaGetNodeContent(pctxt, (xmlNodePtr) attr); if (xmlStrEqual(attrValue, BAD_CAST "qualified")) { @@ -7210,7 +7210,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt, attr_next: attr = attr->next; - } + } /* * 3.2.3 : 2 * If default and use are both present, use must have @@ -7236,7 +7236,7 @@ attr_next: /* 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 @@ attr_next: use->attrDecl = attrDecl; /* * Value constraint. - */ + */ if (defValue != NULL) { attrDecl->defValue = defValue; if (defValueType == WXS_ATTR_DEF_VAL_FIXED) @@ -7333,14 +7333,14 @@ attr_next: 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_children: /* * 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 @@ check_children: return(NULL); } if (! isRef) { - tmpName = name; + tmpName = name; tmpNs = ns; } /* @@ -7381,7 +7381,7 @@ check_children: */ 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 @@ check_children: (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 @@ check_children: 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 @@ check_children: NULL, node, child, NULL, "(annotation?, simpleType?)"); } - } + } return (WXS_BASIC_CAST use); } @@ -7486,7 +7486,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt, if (ret == NULL) return (NULL); ret->flags |= XML_SCHEMAS_ATTR_GLOBAL; - + /* * Check for illegal attributes. */ @@ -7546,7 +7546,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt, (!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 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt, } xmlSchemaPValAttrQName(pctxt, schema, NULL, node, "type", &ret->typeNs, &ret->typeName); - + xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id"); /* * Attribute "fixed". @@ -7641,12 +7641,12 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt, */ 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 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema, name, pctxt->targetNamespace, node); if (ret == NULL) - return (NULL); + return (NULL); /* * Check for illegal attributes. */ @@ -8185,7 +8185,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem, * Returns the parsed identity-constraint definition. */ static xmlSchemaIDCSelectPtr -xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, +xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, xmlSchemaIDCPtr idc, xmlNodePtr node, int isField) @@ -9195,7 +9195,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * 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 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, NULL, node, "This is a redefinition, thus the " " must have a child", NULL); } - + ctxt->ctxtType = oldCtxtType; return (type); } @@ -9373,13 +9373,13 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, child = child->next; } - + if (child != NULL) { xmlSchemaPContentErr(ctxt, @@ -9631,7 +9631,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt, } 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 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con) xmlFree(con); } -static xmlSchemaConstructionCtxtPtr +static xmlSchemaConstructionCtxtPtr xmlSchemaConstructionCtxtCreate(xmlDictPtr dict) { xmlSchemaConstructionCtxtPtr ret; @@ -9954,10 +9954,10 @@ xmlSchemaNewParserCtxtUseDict(const char *URL, xmlDictPtr dict) 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 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt, ret = pctxt->err; goto exit; } - + exit: WXS_CONSTRUCTOR(pctxt)->bucket = oldbucket; /* Restore schema values. */ @@ -10165,7 +10165,7 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaSchemaRelationAddChild(xmlSchemaBucketPtr bucket, 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 @@ xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location, } return(NULL); } - + /** @@ -10267,8 +10267,8 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, if (bucket != NULL) *bucket = NULL; - + switch (type) { case XML_SCHEMA_SCHEMA_IMPORT: case XML_SCHEMA_SCHEMA_MAIN: @@ -10291,23 +10291,23 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, */ relation = xmlSchemaSchemaRelationCreate(); if (relation == NULL) - return(-1); + return(-1); xmlSchemaSchemaRelationAddChild(pctxt->constructor->bucket, relation); relation->type = type; @@ -10329,7 +10329,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, } /* 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, "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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, } goto exit; } - } - /* + } + /* * No bucket + first location: load the doc and create a * bucket. */ } else { /* and */ 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, } else { relation->bucket = bkt; goto exit; - } + } } } if ((bkt != NULL) && (bkt->doc != NULL)) { @@ -10521,7 +10521,7 @@ doc_load: NULL, NULL, SCHEMAS_PARSE_OPTIONS); schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer"); if (doc != NULL) - doc->URL = schemaLocation; + doc->URL = schemaLocation; } /* * For : @@ -10575,11 +10575,11 @@ doc_load: 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 @@ doc_load: 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 @@ doc_load: 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 @@ exit_failure: xmlFreeDoc(doc); if (bkt != NULL) bkt->doc = NULL; - } + } return (-1); } @@ -10810,11 +10810,11 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, "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 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt, } goto exit_error; } - + return(0); exit_error: return(pctxt->err); @@ -10936,19 +10936,19 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, } 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, /* * 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, } 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 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, */ child = child->next; } - } + } if (child != NULL) { res = XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED; if (type == XML_SCHEMA_SCHEMA_REDEFINE) { @@ -11113,8 +11113,8 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPContentErr(pctxt, res, NULL, node, child, NULL, "(annotation?)"); - } - } + } + } return(res); exit_error: @@ -11164,7 +11164,7 @@ xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, * 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 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } ctxt->redef->reference = WXS_BASIC_CAST part; ctxt->redefCounter++; - } + } } } else if (IS_SCHEMA(child, "any")) { part = (xmlSchemaTreeItemPtr) @@ -11425,7 +11425,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, WXS_ADD_PENDING(ctxt, item); } if (withParticle) - return ((xmlSchemaTreeItemPtr) particle); + return ((xmlSchemaTreeItemPtr) particle); else return ((xmlSchemaTreeItemPtr) item); } @@ -11477,7 +11477,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* - * Attribute + * Attribute */ /* * Extract the base type. The "base" attribute is mandatory if inside @@ -11526,7 +11526,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, type->base = NULL; type->baseNs = NULL; } - } + } } /* * And now for the children... @@ -11593,7 +11593,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Model group reference . */ - } else if (IS_SCHEMA(child, "group")) { + } else if (IS_SCHEMA(child, "group")) { type->subtypes = (xmlSchemaTypePtr) xmlSchemaParseModelGroupDefRef(ctxt, schema, child); /* @@ -11931,13 +11931,13 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { return (NULL); - } + } } if (topLevel == 0) { @@ -12183,7 +12183,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, NULL, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction)) ", attrValue, NULL, NULL, NULL); - } else + } else block = 1; } else { xmlSchemaPIllegalAttrErr(ctxt, @@ -12212,7 +12212,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, 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 @@ xmlSchemaNewMemParserCtxt(const char *buffer, int size) return(NULL); ret->buffer = buffer; ret->size = size; - ret->dict = xmlDictCreate(); + ret->dict = xmlDictCreate(); return (ret); } @@ -12491,7 +12491,7 @@ xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt) 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 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt, } 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 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributeUsePtr attruse, 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, if ((bEffValue != NULL) && (effFixed == 1)) { const xmlChar *rEffValue = NULL; - + xmlSchemaGetEffectiveValueConstraint(bcur, &effFixed, &rEffValue, NULL); /* @@ -14126,7 +14126,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, (! 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 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, break; } } -not_found: +not_found: if (!found) { /* * (2.2) "otherwise the {base type definition} must have an @@ -14159,7 +14159,7 @@ not_found: (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 @@ not_found: } } /* - * 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 @@ not_found: 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 @@ not_found: } if (!found) { xmlChar *strA = NULL, *strB = NULL; - + xmlSchemaCustomErr4(ACTXT_CAST pctxt, XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, NULL, item, @@ -14224,19 +14224,19 @@ not_found: /* * (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 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt, xmlSchemaTypePtr type) { xmlSchemaTypePtr baseType = NULL; - xmlSchemaAttributeUsePtr use; + xmlSchemaAttributeUsePtr use; xmlSchemaItemListPtr uses, baseUses, prohibs = NULL; if (type->baseType == NULL) { @@ -14324,7 +14324,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt, "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 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt, if (WXS_IS_RESTRICTION(type)) { int usesCount; - xmlSchemaAttributeUsePtr tmp; + xmlSchemaAttributeUsePtr tmp; if (uses != NULL) usesCount = uses->nbItems; @@ -14420,15 +14420,15 @@ inherit_next: {} } } 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 @@ inherit_next: {} /* * 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 @@ inherit_next: {} */ 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 @@ inherit_next: {} * NOOP */ } - + return (0); exit_failure: @@ -14865,10 +14865,10 @@ static int xmlSchemaCheckUnionTypeDefCircularRecur(xmlSchemaParserCtxtPtr pctxt, xmlSchemaTypePtr ctxType, xmlSchemaTypeLinkPtr members) -{ +{ xmlSchemaTypeLinkPtr member; xmlSchemaTypePtr memberType; - + member = members; while (member != NULL) { memberType = member->type; @@ -14969,7 +14969,7 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef, } 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 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef, * 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 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, * @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 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt, * 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 alternative is chosen, @@ -15633,7 +15633,7 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt, * NOTE: This is checked in the parse function of . */ /* - * + * */ } else if (WXS_IS_LIST(type)) { /* src-simple-type.3 "If the alternative is chosen, either it must have @@ -15642,8 +15642,8 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt, * * NOTE: This is checked in the parse function of . */ - } else if (WXS_IS_UNION(type)) { - /* + } else if (WXS_IS_UNION(type)) { + /* * src-simple-type.4 is checked in xmlSchemaCheckUnionTypeDefCircular(). */ } @@ -15798,7 +15798,7 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, */ 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 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * - 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 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, if (xmlSchemaItemListRemove(uses, i) == -1) goto exit_failure; } - + hasId = 1; } } @@ -16037,7 +16037,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, "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 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, } 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 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, base->attributeWildcard, type->attributeWildcard)) { xmlChar *str = NULL; - + xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_3, NULL, type, @@ -16293,7 +16293,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, */ 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 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, * * 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 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, /* * 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 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, if (! xmlSchemaIsParticleEmptiable( (xmlSchemaParticlePtr) base->subtypes)) { ret = XML_SCHEMAP_SRC_CT_1; - } else + } else /* * Attention: at this point the child is in * ->contentTypeDef (put there during parsing). - */ + */ if (type->contentTypeDef == NULL) { xmlChar *str = NULL; /* @@ -17131,7 +17131,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, /* * 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 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) } 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 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) has = 1; break; } - } + } } if (normVal) type->flags |= XML_SCHEMAS_TYPE_NORMVALUENEEDED; @@ -17751,24 +17751,24 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) 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 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type) } } /* - * 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 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, } else if (WXS_IS_UNION(type)) { /* * Corresponds to ... - */ + */ if (type->memberTypes == NULL) { /* * This one is really needed, so get out. @@ -17853,8 +17853,8 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, PERROR_INT("xmlSchemaFixupSimpleTypeStageOne", "union type has no member-types assigned"); return(-1); - } - } else { + } + } else { /* * Corresponds to ... */ @@ -17969,7 +17969,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, } 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 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, */ 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 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, */ res = xmlSchemaCheckSTPropsCorrect(pctxt, type); HFAILURE HERROR - /* + /* * Schema Component Constraint: Derivation Valid (Restriction, Simple) * (cos-st-restricts) */ @@ -18023,7 +18023,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, */ res = xmlSchemaTypeFixupWhitespace(type); HFAILURE HERROR - xmlSchemaTypeFixupOptimFacets(type); + xmlSchemaTypeFixupOptimFacets(type); exit_error: #ifdef DEBUG_TYPE @@ -18054,7 +18054,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, PERROR_INT("xmlSchemaFixupComplexType", "missing baseType"); goto exit_failure; - } + } /* * Fixup the base type. */ @@ -18066,12 +18066,12 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMA_TYPE_SEQUENCE, type->node); if (particle->children == NULL) goto exit_failure; - + type->subtypes = (xmlSchemaTypePtr) particle; } dummySequence = 1; @@ -18580,11 +18580,11 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, } } else base = typeDecl; - + if (! ctxtGiven) { /* * A context is needed if called from RelaxNG. - */ + */ pctxt = xmlSchemaNewParserCtxt("*"); if (pctxt == NULL) return (-1); @@ -18595,17 +18595,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, * 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 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, /* 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 @@ xmlSchemaModelGroupToModelGroupDefFixup( { particle = WXS_PTC_CAST particle->next; continue; - } + } if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) { /* * TODO: Remove the particle. @@ -18953,7 +18953,7 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr, 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 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr, { 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 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr, return(0); else { xmlSchemaQNameRefPtr circ; - + circ = xmlSchemaCheckAttrGroupCircularRecur(attrGr, - (xmlSchemaItemListPtr) attrGr->attrUses); + (xmlSchemaItemListPtr) attrGr->attrUses); if (circ != NULL) { xmlChar *str = NULL; /* @@ -19040,7 +19040,7 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, /* * Note that duplicate prohibitions were already * handled at parsing time. - */ + */ /* * Add to list of prohibitions. */ @@ -19137,7 +19137,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, *completeWild = tmpWild; created = 1; } - + if (xmlSchemaIntersectWildcards(pctxt, *completeWild, gr->attributeWildcard) == -1) return(-1); @@ -19211,7 +19211,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, /** * xmlSchemaAttributeGroupExpandRefs: * @pctxt: the parser context - * @attrGr: the attribute group definition + * @attrGr: the attribute group definition * * Computation of: * {attribute uses} property @@ -19223,7 +19223,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, static int xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, xmlSchemaAttributeGroupPtr attrGr) -{ +{ if ((attrGr->attrUses == NULL) || (attrGr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED)) return(0); @@ -19231,25 +19231,25 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, FREE_AND_NULL(str); if (xmlSchemaItemListRemove(uses, i) == -1) return(-1); - } + } hasId = 1; } } @@ -19392,7 +19392,7 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt, return(pctxt->err); } } - + return(0); } @@ -19767,12 +19767,12 @@ add_member: * @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 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, int ret = 0; xmlSchemaParticlePtr cur = curParticle; - if (curParticle == NULL) { + if (curParticle == NULL) { return(0); } if (WXS_PARTICLE_TERM(curParticle) == NULL) { @@ -19790,7 +19790,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, 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 @@ exit: * @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 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl, /* * Adds substitution group members. */ - xmlSchemaCheckElemSubstGroup(ctxt, elemDecl); + xmlSchemaCheckElemSubstGroup(ctxt, elemDecl); } } @@ -19928,7 +19928,7 @@ xmlSchemaResolveModelGroupParticleReferences( XML_SCHEMA_EXTRA_QNAMEREF)) { goto next_particle; - } + } ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle); /* * Resolve the reference. @@ -19944,7 +19944,7 @@ xmlSchemaResolveModelGroupParticleReferences( 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 @@ next_particle: 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 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x, 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 @@ xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause, /** * 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 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, * 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 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, 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 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, NULL, NULL); return(ctxt->err); } - + ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt, use->node, WXS_ATTRUSE_TYPEDEF(use), use->defValue, &(use->defVal), @@ -20203,7 +20203,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, /** * xmlSchemaResolveAttrTypeReferences: * @item: an attribute declaration - * @ctxt: a parser context + * @ctxt: a parser context * * Resolves the referenced type definition component. */ @@ -20294,7 +20294,7 @@ xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc, ((xmlSchemaIDCPtr) idc->ref->item)->nbFields) { xmlChar *str = NULL; xmlSchemaIDCPtr refer; - + refer = (xmlSchemaIDCPtr) idc->ref->item; /* * SPEC c-props-correct(2) @@ -20353,7 +20353,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) int wasRedefined; if (redef == NULL) - return(0); + return(0); do { item = redef->item; @@ -20368,7 +20368,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) * 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 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) /* * 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 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) 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 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) * 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 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) default: PERROR_INT("xmlSchemaResolveRedefReferences", "Unexpected redefined component type"); - return(-1); + return(-1); } if (wasRedefined) { xmlChar *str = NULL; @@ -20499,7 +20499,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) 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 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) "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 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt) xmlSchemaBasicItemPtr item; if (redef == NULL) - return(0); + return(0); do { if (redef->target == NULL) { @@ -20535,7 +20535,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt) continue; } item = redef->item; - + switch (item->type) { case XML_SCHEMA_TYPE_SIMPLE: case XML_SCHEMA_TYPE_COMPLEX: @@ -20544,7 +20544,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt) * 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 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt) } while (redef != NULL); return(0); } - + static int xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, @@ -20627,8 +20627,8 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, "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 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, "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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, /* * Add global components to the schemata's hash tables. - */ + */ xmlSchemaAddComponents(pctxt, rootBucket); pctxt->ctxtType = NULL; @@ -20765,7 +20765,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, } 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, break; default: break; - } + } } if (pctxt->nberrors != 0) goto exit_error; @@ -20904,7 +20904,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, } 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, switch (item->type) { case XML_SCHEMA_TYPE_SIMPLE: if (((xmlSchemaTypePtr) item)->memberTypes != NULL) { - xmlSchemaCheckUnionTypeDefCircular(pctxt, + xmlSchemaCheckUnionTypeDefCircular(pctxt, (xmlSchemaTypePtr) item); FIXHFAILURE; } @@ -20976,7 +20976,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, } if (pctxt->nberrors != 0) goto exit_error; - + /* * Do the complete type fixup for simple types. */ @@ -21004,10 +21004,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, goto exit_error; /* * Apply constraints for attribute uses. - */ + */ for (i = 0; i < nbItems; i++) { item = items[i]; switch (item->type) { @@ -21063,7 +21063,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, if (pctxt->nberrors != 0) goto exit_error; - /* + /* * Complex types are builded and checked. */ for (i = 0; i < nbItems; i++) { @@ -21087,8 +21087,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, } if (pctxt->nberrors != 0) goto exit_error; - + /* * Finally we can build the automaton from the content model of * complex types. @@ -21148,10 +21148,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, 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 @@ exit: * 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 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt) 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 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt) "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 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt) * 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 @@ exit: ctxt->schema = NULL; return(mainSchema); exit_failure: - /* + /* * Quite verbose, but should catch internal errors, which were * not communitated. */ @@ -21296,7 +21296,7 @@ exit_failure: ctxt->ownsConstructor = 0; } PERROR_INT2("xmlSchemaParse", - "An internal error occured"); + "An internal error occured"); ctxt->schema = NULL; return(NULL); } @@ -21521,11 +21521,11 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt, 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 @@ exit_failure: } static xmlSchemaAttrInfoPtr -xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt, +xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt, int metaType) { if (vctxt->nbAttrInfos == 0) @@ -21682,7 +21682,7 @@ xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt) /* * 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 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, #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 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCFreeBinding(xmlSchemaPSVIIDCBindingPtr bind) if (bind->nodeTable != NULL) xmlFree(bind->nodeTable); if (bind->dupls != NULL) - xmlSchemaItemListFree(bind->dupls); + xmlSchemaItemListFree(bind->dupls); xmlFree(bind); } @@ -22178,12 +22178,12 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher) 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 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt, } xmlSchemaItemListFree(matcher->targets); matcher->targets = NULL; - } + } matcher->next = NULL; /* * Cache the matcher. @@ -22294,7 +22294,7 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, sto = vctxt->xpathStatePool; vctxt->xpathStatePool = sto->next; sto->next = NULL; - } else { + } else { /* * Create a new state object. */ @@ -22305,10 +22305,10 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, { xmlSchemaIDCStateObjPtr sto, head = NULL, first; int res, resolved = 0, depth = vctxt->depth; - + if (vctxt->xpathStates == NULL) return (0); @@ -22367,8 +22367,8 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, #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 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt, *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 @@ xmlSchemaXPathPop(xmlSchemaValidCtxtPtr vctxt) * * 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, #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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, } } 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, sto->nbHistory--; goto deregister_check; } - + if ((key == NULL) && (vctxt->inode->val == NULL)) { /* * Failed to provide the normalized value; maybe @@ -22665,13 +22665,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, 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 * 0 NULL * 1 NULL @@ -22682,23 +22682,23 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, 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 @@ create_key: "allocating a IDC key", NULL); xmlFree(keySeq); matcher->keySeqs[pos] = NULL; - return(-1); + return(-1); } /* * Consume the compiled value. @@ -22803,10 +22803,10 @@ create_key: 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 @@ create_key: /* * 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 @@ create_key: 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 @@ create_key: * 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 @@ create_key: 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 @@ create_key: ((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 @@ create_key: } 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 @@ create_key: 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 @@ create_key: xmlFree(ntItem); xmlFree(*keySeq); *keySeq = NULL; - return (-1); + return (-1); } } /* @@ -22979,11 +22979,11 @@ create_key: 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 @@ create_key: } 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 @@ selector_leave: *keySeq = NULL; } } /* if selector */ - + sto->nbHistory--; deregister_check: @@ -23070,15 +23070,15 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, "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 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, nbDupls = bind->dupls->nbItems; } else { dupls = NULL; - nbDupls = 0; + nbDupls = 0; } if (bind->nodeTable != NULL) { nbNodeTable = bind->nbNodes; @@ -23239,29 +23239,29 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, } } 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 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, goto next_node_table_entry; } } - } + } /* * Add the duplicate to the list of duplicates. */ @@ -23335,7 +23335,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, 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 @@ internal_error: } /** - * 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) * 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) * 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) /* 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) j++; continue; } - } else { + } else { for (k = 0; k < nbFields; k++) { ret = xmlSchemaAreValuesEqual( node->keys[k]->val, @@ -23532,20 +23532,20 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) * 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) parNodes[parBind->nbNodes++] = node; } - } - - } + } + + } } else { /* * No binding for the IDC was found: create a new one and @@ -23598,7 +23598,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) /* * 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 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) { xmlSchemaIDCMatcherPtr matcher; xmlSchemaPSVIIDCBindingPtr bind; - + matcher = vctxt->inode->idcMatchers; /* * Find a keyref. @@ -23699,7 +23699,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) */ 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 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) } } } - + if (res == 0) { xmlChar *str = NULL, *strB = NULL; xmlSchemaKeyrefErr(vctxt, @@ -23852,7 +23852,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, xmlNodePtr attrNode, int nodeLine, const xmlChar *localName, - const xmlChar *nsName, + const xmlChar *nsName, int ownedNames, xmlChar *value, int ownedValue) @@ -23878,7 +23878,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, valType = valType; else valType = xmlSchemaGetValType(val); - + ret = 0; for (facetLink = type->facetSet; facetLink != NULL; facetLink = facetLink->next) { @@ -24148,11 +24148,11 @@ WXS_IS_LIST: 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 @@ WXS_IS_LIST: "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 @@ pattern_and_enum: 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 @@ pattern_and_enum: "validating against a pattern facet"); return (-1); } else { - /* + /* * Save the last non-validating facet. */ facet = facetLink->facet; @@ -24276,12 +24276,12 @@ pattern_and_enum: 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 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt, int ret; const xmlChar *nsName; xmlChar *local, *prefix = NULL; - + ret = xmlValidateQName(value, 1); if (ret != 0) { if (ret == -1) { @@ -24323,7 +24323,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt, * - is there a default namespace? */ nsName = xmlSchemaLookupNamespace(vctxt, prefix); - + if (prefix != NULL) { xmlFree(prefix); /* @@ -24380,7 +24380,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, value = normValue; \ isNormalized = 1; \ } - + if ((retVal != NULL) && (*retVal != NULL)) { xmlSchemaFreeValue(*retVal); *retVal = NULL; @@ -24441,9 +24441,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, ret = xmlSchemaValPredefTypeNodeNoNorm(biType, value, NULL, node); break; - } + } } else { /* * Validation via a public API is not implemented yet. @@ -24496,7 +24496,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, } ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; break; - } + } cur = end; } while (*cur != 0); FREE_AND_NULL(tmpValue); @@ -24599,7 +24599,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, } } if (fireErrors && (ret > 0)) { - /* + /* * Report the normalized value. */ normalize = 1; @@ -24629,7 +24629,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * 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 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "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 @@ xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt) 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 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) } 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 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * 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 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) /* * 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 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) iattr->node, iattr->typeDef, iattr->value, NULL, 1, 0, 0); } - + if (res != 0) { if (res == -1) { VERROR_INT("xmlSchemaVAttributesComplex", @@ -25549,7 +25549,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) 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 @@ eval_idcs: 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 @@ xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt, 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 @@ static int 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 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, "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 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, if (ret < 0) { VERROR_INT("xmlSchemaCheckCOSValidDefault", "calling xmlSchemaVCheckCVCSimpleType()"); - } + } return (ret); } @@ -25866,13 +25866,13 @@ xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED, 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 @@ xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt, -/* +/* * Process END of element. */ static int @@ -25914,7 +25914,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) */ 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 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) * 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 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) #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 @@ character_content: /* * 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 @@ character_content: 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 @@ character_content: * (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 @@ default_psvi: xmlChar *normValue; /* * VAL TODO: Normalize the value. - */ + */ normValue = xmlSchemaNormalizeValue(inode->typeDef, inode->decl->value); if (normValue != NULL) { @@ -26118,15 +26118,15 @@ default_psvi: "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 @@ default_psvi: * (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 @@ default_psvi: * 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 @@ default_psvi: 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 @@ default_psvi: * 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 @@ default_psvi: 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 @@ default_psvi: } } 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 @@ default_psvi: 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 @@ end_elem: 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 @@ end_elem: * 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 @@ end_elem: */ if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1) goto internal_error; - } + } } /* * Clear the current ielem. @@ -26335,10 +26335,10 @@ end_elem: 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 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, * 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 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, } return (0); } - + if ((value == NULL) || (value[0] == 0)) return (0); /* @@ -26649,7 +26649,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, ((vctxt->inode->decl == NULL) || (vctxt->inode->decl->value == NULL))) return (0); - + if (vctxt->inode->value == NULL) { /* * Set the value. @@ -26692,7 +26692,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, 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 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len); vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES; } - } + } return (0); } @@ -26718,7 +26718,7 @@ xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt) 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 @@ type_validation: 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 @@ root_found: nodeType = xmlTextReaderNodeType(vctxt->reader); if (nodeType == XML_ELEMENT_NODE) { - + vctxt->depth++; if (xmlSchemaValidatorPushElem(vctxt) == -1) { VERROR_INT("xmlSchemaVReaderWalk", @@ -27092,8 +27092,8 @@ internal_error: * 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 @@ xmlSchemaSAXHandleText(void *ctx, * 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 @@ xmlSchemaSAXHandleReference(void *ctx ATTRIBUTE_UNUSED, 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 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, 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 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, } else ielem->nsBindings[ielem->nbNsBindings * 2 + 1] = namespaces[j+1]; - ielem->nbNsBindings++; + ielem->nbNsBindings++; } } /* @@ -27254,7 +27254,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, 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 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, goto internal_error; } goto exit; - } + } exit: return; @@ -27391,7 +27391,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) #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 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) break; xmlSchemaClearElemInfo(vctxt, ei); } - } + } xmlSchemaItemListClear(vctxt->nodeQNames); /* Recreate the dict. */ xmlDictFree(vctxt->dict); @@ -27563,7 +27563,7 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt) * @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 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, /** * 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 @@ xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt, /** * xmlSchemaValidCtxtGetOptions: - * @ctxt: a schema validation context + * @ctxt: a schema validation context * * Get the validation context options. * @@ -27751,7 +27751,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt) nsName = NULL; ret = xmlSchemaValidatorPushAttribute(vctxt, (xmlNodePtr) attr, - /* + /* * Note that we give it the line number of the * parent element. */ @@ -27807,7 +27807,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt) (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 @@ static int xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { /* * Some initialization. - */ + */ vctxt->err = 0; vctxt->nberrors = 0; vctxt->depth = -1; @@ -27884,9 +27884,9 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { */ 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 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { */ 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 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { * 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 @@ referenceSplit(void *ctx, const xmlChar *name) } 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 @@ startElementNsSplit(void *ctx, const xmlChar * localname, } 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 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, 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 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, 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 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, } 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 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt, if (options) xmlCtxtUseOptions(pctxt, options); #endif - pctxt->linenumbers = 1; + pctxt->linenumbers = 1; inputStream = xmlNewIOInputStream(pctxt, input, enc);; if (inputStream == NULL) { @@ -28658,16 +28658,33 @@ xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt, 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 */