Commit c0826a77 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

applied Schemas patches from Kasimier Buchcik lot of new tests for things

* configure.in xmlregexp.c xmlschemas.c xmlschemastypes.c
  include/libxml/schemasInternals.h include/libxml/xmlerror.h
  include/libxml/xmlschemastypes.h: applied Schemas patches
  from Kasimier Buchcik
* test/ result/ bug141333* annot-err* any[1-4]* bug145246*
  element-err* element-minmax-err* include1* restrict-CT-attr-ref*:
  lot of new tests for things fixed by the patch
Daniel
parent 2d908039
Tue Aug 10 07:19:31 PDT 2004 Daniel Veillard <daniel@veillard.com>
* configure.in xmlregexp.c xmlschemas.c xmlschemastypes.c
include/libxml/schemasInternals.h include/libxml/xmlerror.h
include/libxml/xmlschemastypes.h: applied Schemas patches
from Kasimier Buchcik
* test/ result/ bug141333* annot-err* any[1-4]* bug145246*
element-err* element-minmax-err* include1* restrict-CT-attr-ref*:
lot of new tests for things fixed by the patch
Fri Aug 6 09:22:34 PDT 2004 William Brack <wbrack@mmm.com.hk>
 
* valid.c: fixed my mis-handling of External ID on last
......
......@@ -9,7 +9,12 @@ to help those - More testing on RelaxNG
- Finishing up XML
Schemas
There is the list of public releases:
The change log at
ChangeLog.html
describes the recents commits
to the CVS at
http://cvs.gnome.org/viewcvs/libxml2/
code base.There is the list of public releases:
2.6.11: July 5 2004:
- Schemas: a lot of changes and improvements by Kasimier Buchcik for
attributes, namespaces and simple types.
......
/* config.h.in. Generated from configure.in by autoheader. */
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
#undef HAVE_LIBM
#undef HAVE_ISINF
#undef HAVE_ISNAN
#undef HAVE_LIBHISTORY
#undef HAVE_LIBREADLINE
#undef SOCKLEN_T
#undef HAVE_LIBPTHREAD
#undef HAVE_PTHREAD_H
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if IPV6 support is there */
#undef SUPPORT_IP6
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you have the <ansidecl.h> header file. */
#undef HAVE_ANSIDECL_H
/* Define if you have the _stat function. */
#undef HAVE__STAT
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define if you have the class function. */
#undef HAVE_CLASS
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Define if you have the finite function. */
#undef HAVE_FINITE
/* Define to 1 if you have the `class' function. */
#undef HAVE_CLASS
/* Define if you have the fp_class function. */
#undef HAVE_FP_CLASS
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define if you have the fpclass function. */
#undef HAVE_FPCLASS
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the fprintf function. */
#undef HAVE_FPRINTF
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the ftime function. */
#undef HAVE_FTIME
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the isnand function. */
#undef HAVE_ISNAND
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
/* Define if you have the localtime function. */
#undef HAVE_LOCALTIME
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define if you have the printf function. */
#undef HAVE_PRINTF
/* Define to 1 if you have the `fpclass' function. */
#undef HAVE_FPCLASS
/* Define if you have the signal function. */
#undef HAVE_SIGNAL
/* Define to 1 if you have the `fprintf' function. */
#undef HAVE_FPRINTF
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `fp_class' function. */
#undef HAVE_FP_CLASS
/* Define if you have the sprintf function. */
#undef HAVE_SPRINTF
/* Define to 1 if you have the <fp_class.h> header file. */
#undef HAVE_FP_CLASS_H
/* Define if you have the sscanf function. */
#undef HAVE_SSCANF
/* Define to 1 if you have the `ftime' function. */
#undef HAVE_FTIME
/* Define if you have the stat function. */
#undef HAVE_STAT
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if isinf is there */
#undef HAVE_ISINF
/* Define if you have the vfprintf function. */
#undef HAVE_VFPRINTF
/* Define if isnan is there */
#undef HAVE_ISNAN
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `isnand' function. */
#undef HAVE_ISNAND
/* Define if you have the vsprintf function. */
#undef HAVE_VSPRINTF
/* Define if history library is there (-lhistory) */
#undef HAVE_LIBHISTORY
/* Define if you have the <ansidecl.h> header file. */
#undef HAVE_ANSIDECL_H
/* Define to 1 if you have the `inet' library (-linet). */
#undef HAVE_LIBINET
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Define if pthread library is there (-lpthread) */
#undef HAVE_LIBPTHREAD
/* Define if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define if readline library is there (-lreadline) */
#undef HAVE_LIBREADLINE
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Have compression library */
#undef HAVE_LIBZ
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `localtime' function. */
#undef HAVE_LOCALTIME
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define if you have the <fp_class.h> header file. */
#undef HAVE_FP_CLASS_H
/* Define if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define to 1 if you have the <malloc.h> header file. */
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <math.h> header file. */
/* Define if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <nan.h> header file. */
/* Define if you have the <nan.h> header file. */
#undef HAVE_NAN_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <netdb.h> header file. */
/* Define if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `printf' function. */
#undef HAVE_PRINTF
/* Define if <pthread.h> is there */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the <resolv.h> header file. */
/* Define if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
/* Define to 1 if you have the <signal.h> header file. */
/* Define if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `sprintf' function. */
#undef HAVE_SPRINTF
/* Define to 1 if you have the `sscanf' function. */
#undef HAVE_SSCANF
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define to 1 if you have the <stdarg.h> header file. */
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/mman.h> header file. */
/* Define if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/select.h> header file. */
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
/* Define to 1 if you have the <sys/time.h> header file. */
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
/* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <time.h> header file. */
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the <unistd.h> header file. */
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if you have the `vsprintf' function. */
#undef HAVE_VSPRINTF
/* Define if you have the inet library (-linet). */
#undef HAVE_LIBINET
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define to 1 if you have the `_stat' function. */
#undef HAVE__STAT
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION
/* Define to 1 if the C compiler supports function prototypes. */
/* Define if compiler has function prototypes */
#undef PROTOTYPES
/* Have compression library */
#undef HAVE_LIBZ
/* Determine what socket length (socklen_t) data type is */
#undef SOCKLEN_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Support for IPv6 */
#undef SUPPORT_IP6
/* Version number of package */
#undef VERSION
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define if isnan is there */
#undef HAVE_ISNAN
/* Define if isnan is there */
#undef HAVE_ISNAN
/* Define if isinf is there */
#undef HAVE_ISINF
/* Define if isinf is there */
#undef HAVE_ISINF
/* Define if pthread library is there (-lpthread) */
#undef HAVE_LIBPTHREAD
/* Define if <pthread.h> is there */
#undef HAVE_PTHREAD_H
/* Define if history library is there (-lhistory) */
#undef HAVE_LIBHISTORY
/* Define if readline library is there (-lreadline) */
#undef HAVE_LIBREADLINE
/* Using the Win32 Socket implementation */
#undef _WINSOCKAPI_
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
/* Win32 Std C name mangling work-around */
#undef snprintf
/* Win32 Std C name mangling work-around */
#undef vsnprintf
......@@ -298,7 +298,7 @@ else
CFLAGS="${CFLAGS} -fexceptions"
fi
CFLAGS="${CFLAGS} -Wall"
CFLAGS="${CFLAGS} -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
......
......@@ -204,18 +204,30 @@ struct _xmlSchemaAnnot {
*/
#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
/**
* XML_SCHEMAS_ATTR_GLOBAL:
* XML_SCHEMAS_ATTR_GLOABAL:
*
* allow elements in no namespace
*/
#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
/**
* XML_SCHEMAS_ATTR_NSDEFAULT:
*
* allow elements in no namespace
*/
#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
/**
* XML_SCHEMAS_ATTR_NSDEFAULT:
*
* this is set when the "type" and "ref" references
* have been resolved.
*/
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
/**
* XML_SCHEMAS_ATTR_FIXED:
*
* the attribute has a fixed value
*/
#define XML_SCHEMAS_ATTR_FIXED 1 << 9
/**
* xmlSchemaAttribute:
......@@ -226,22 +238,23 @@ typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
struct _xmlSchemaAttribute {
xmlSchemaTypeType type; /* The kind of type */
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
const xmlChar *name;
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
const xmlChar *name; /* name of the declaration or empty if particle */
const xmlChar *id;
const xmlChar *ref;
const xmlChar *refNs;
const xmlChar *typeName;
const xmlChar *typeNs;
const xmlChar *ref; /* the local name of the attribute decl. if a particle */
const xmlChar *refNs; /* the ns URI of the attribute decl. if a particle */
const xmlChar *typeName; /* the local name of the type definition */
const xmlChar *typeNs; /* the ns URI of the type definition */
xmlSchemaAnnotPtr annot;
xmlSchemaTypePtr base;
xmlSchemaTypePtr base; /* obsolete, not used */
int occurs;
const xmlChar *defValue;
xmlSchemaTypePtr subtypes;
xmlSchemaTypePtr subtypes; /* the type definition */
xmlNodePtr node;
const xmlChar *targetNamespace;
const xmlChar *targetNamespace;
int flags;
const xmlChar *refPrefix;
};
/**
......@@ -327,6 +340,7 @@ struct _xmlSchemaAttributeGroup {
xmlNodePtr node;
int flags;
xmlSchemaWildcardPtr attributeWildcard;
const xmlChar *refPrefix;
};
/**
......@@ -432,15 +446,15 @@ struct _xmlSchemaFacetLink {
*/
#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
/**
* XML_SCHEMAS_TYPE_FINAL_DEFAULT:
* XML_SCHEMAS_TYPE_FINAL_UNION:
*
* the simpleType has a final of "default".
* the simpleType has a final of "union".
*/
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
/**
* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
* XML_SCHEMAS_TYPE_FINAL_UNION:
*
* the simpleType is a built-in primitive.
* the simpleType has a final of "union".
*/
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
......@@ -467,7 +481,7 @@ struct _xmlSchemaType {
xmlSchemaContentType contentType;
const xmlChar *base;
const xmlChar *baseNs;
xmlSchemaTypePtr baseType;
xmlSchemaTypePtr baseType;
xmlSchemaFacetPtr facets;
struct _xmlSchemaType *redef;/* possible redefinitions for the type */
int recurse;
......@@ -476,6 +490,8 @@ struct _xmlSchemaType {
int builtInType;
xmlSchemaTypeLinkPtr memberTypes;
xmlSchemaFacetLinkPtr facetSet;
const xmlChar *refPrefix;
xmlSchemaTypePtr contentTypeDef;
};
/*
......@@ -535,6 +551,62 @@ struct _xmlSchemaType {
* Obsolete, not used anymore.
*/
#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
/**
* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
*
* this is set when "type", "ref", "substitutionGroup"
* references have been resolved.
*/
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
/**
* XML_SCHEMAS_ELEM_CIRCULAR
*
* a helper flag for the search of circular references.
*/
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
/**
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
*
* the "block" attribute is absent
*/
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
/**
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
*
* disallowed substitutions are absent
*/
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
/**
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
*
* disallowed substitutions: "restriction"
*/
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
/**
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
*
* disallowed substitutions: "substituion"
*/
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
/**
* XML_SCHEMAS_ELEM_FINAL_ABSENT:
*
* substitution group exclusions are absent
*/
#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
/**
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
*
* substitution group exclusions: "extension"
*/
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
/**
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
*
* substitution group exclusions: "restriction"
*/
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
typedef struct _xmlSchemaElement xmlSchemaElement;
typedef xmlSchemaElement *xmlSchemaElementPtr;
......@@ -543,10 +615,10 @@ struct _xmlSchemaElement {
struct _xmlSchemaType *next;/* the next type if in a sequence ... */
const xmlChar *name;
const xmlChar *id;
const xmlChar *ref;
const xmlChar *refNs;
const xmlChar *ref; /* the local name of the element declaration if a particle */
const xmlChar *refNs; /* the ns URI of the element declaration if a particle */
xmlSchemaAnnotPtr annot;
xmlSchemaTypePtr subtypes;
xmlSchemaTypePtr subtypes; /* the type definition */
xmlSchemaAttributePtr attributes;