1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00
Commit Graph

203 Commits

Author SHA1 Message Date
Daniel Veillard
a980befc8f fixed xsd:all when used in conjunction with substitution groups adding
* xmlschemas.c: fixed xsd:all when used in conjunction with
  substitution groups
* test/schemas/allsg_* result/schemas/allsg_*: adding specific
  regression tests, strangely missing from NIST/Sun/Microsoft
  testsuites
Daniel
2005-07-18 21:34:03 +00:00
Daniel Veillard
afc05b6871 fixed bug #307508, a bad automata was built but this showed as an
* xmlschemas.c: fixed bug #307508, a bad automata was built but
  this showed as an indeterminist result
Daniel
2005-07-17 06:11:19 +00:00
Daniel Veillard
da0aa4cfdb applied patch from Marcus Boerger to route relaxng and schemas error
* error.c relaxng.c xmlreader.c xmlschemas.c include/libxml/relaxng.h
  include/libxml/xmlschemas.h: applied patch from Marcus Boerger
  to route relaxng and schemas error messages when using the reader
  through the structured interface if activated.
* elfgcchack.h doc/* testapi.c: rebuilt since this add  new APIs
  to test.
Daniel
2005-07-13 23:07:49 +00:00
Daniel Veillard
1f33c4d61f preparing to make testsuite releases along with code source releases fixed
* xstc/Makefile.am README README.tests Makefile.tests Makefile.am:
  preparing to make testsuite releases along with code source releases
* gentest.py testapi.c: fixed a couple of problem introduced by
  the new Schemas support for Readers
* xpath.c: fixed the XPath attribute:: bug #309580, #309864 in a crude
  but simple way.
* xmlschemas.c include/libxml/tree.h: fixed a couple of problems
  raised by the doc builder.
* doc/*: made rebuild
Daniel
2005-07-10 21:38:31 +00:00
Daniel Veillard
df4223ece4 fixed a bug introduced on last commit daniel
* xmlschemas.c: fixed a bug introduced on last commit
daniel
2005-07-10 19:52:06 +00:00
Daniel Veillard
f10ae12cb8 fixed a typo pointed by Jeroen Ruigrok increased the APIs for xmlReader
* doc/xmllint.1 doc/xmllint.html doc/xmllint.xml: fixed a typo
  pointed by Jeroen Ruigrok
* include/libxml/xmlreader.h include/libxml/xmlschemas.h: increased
  the APIs for xmlReader schemas validation support
* xmllint.c xmlreader.c xmlschemas.c: xmlReader schemas validation
  implementation and testing as xmllint --stream --schema ...
Daniel
2005-07-10 19:03:16 +00:00
Daniel Veillard
971771ef5a fix for #309761 from Dylan Shell added xmlSchemaSAXPlug and
* parser.c: fix for #309761 from Dylan Shell
* xmlschemas.c include/libxml/xmlschemas.h: added xmlSchemaSAXPlug
  and xmlSchemaSAXUnplug generic APIs for SAX Schemas validation.
* xmllint.c: couple of fixes plus added descriptions for --sax and
  --sax1
Daniel
2005-07-09 17:32:57 +00:00
Kasimier T. Buchcik
c306d904c6 Added c-props-correct constraint to check for equal cardinality of
* xmlschemas.c: Added c-props-correct constraint to check
  for equal cardinality of keyref/key.
* include/libxml/xmlerror.h: Added an error code.
2005-07-08 21:37:44 +00:00
Kasimier T. Buchcik
85aed6d010 tiny fix in xmlSchemaValidateStream() if a user-provided SAX handler is
* xmlschemas.c: tiny fix in xmlSchemaValidateStream() if a
  user-provided SAX handler is given.
2005-07-08 18:06:18 +00:00
Daniel Veillard
f0af8ec616 fix some potential leaks in error cases. added --sax, to allow testing of
* parser.c: fix some potential leaks in error cases.
* xmllint.c: added --sax, to allow testing of --schemas --sax and
  various other combinations.
* xmlschemas.c: fix a couple of tiny problems in
  xmlSchemaValidateStream()
Daniel
2005-07-08 17:27:33 +00:00
Kasimier T. Buchcik
72d3adc42f Changed xmlSchemaValidateFile() to use xmlSchemaValidateStream()
* xmlschemas.c: Changed xmlSchemaValidateFile() to use
  xmlSchemaValidateStream() internally.
2005-07-08 16:43:37 +00:00
Daniel Veillard
cdc82737e2 added the missing entity to the document internal subset to avoid errors
* test/relaxng/docbook_0.xml: added the missing entity to the
  document internal subset to avoid errors if the DocBook catalogs
  are not there
* xmlschemas.c: first cut at implementing xmlSchemaValidateStream()
  untested yet
Daniel
2005-07-08 15:04:06 +00:00
Daniel Veillard
39e5c89016 fixing a leak detected by testapi in xmlDOMWrapAdoptNode, and fixing
* testapi.c tree.c: fixing a leak detected by testapi in
  xmlDOMWrapAdoptNode, and fixing another side effect in testapi
  seems to pass tests fine now.
* include/libxml/parser.h parser.c: xmlStopParser() is no more limited
  to push mode
* error.c: remove a warning
* runtest.c xmllint.c: avoid compilation errors if only some parts
  of the library are compiled in.
Daniel
2005-07-03 22:48:50 +00:00
Kasimier T. Buchcik
9c215eb384 Fixed NULL values to be validated as empty string values (reported by
* xmlschemas.c: Fixed NULL values to be validated as empty
  string values (reported by Dhyanesh to the mailing list).
  Adjusted text concatenation of mixed content.
2005-06-21 08:38:49 +00:00
Kasimier T. Buchcik
84a56e313d Fixed SAX2 validation: grow of internal namespace list, appending of
* xmlschemas.c: Fixed SAX2 validation: grow of internal
  namespace list, appending of element character content.
* xstc/xstc.py: Added "--sax" option for SAX2 validation.
2005-06-16 12:44:35 +00:00
Daniel Veillard
81562d2d66 if sax1 is used and input is a file use the old API xmlParseFile()
* xmllint.c: if sax1 is used and input is a file use the old
  API xmlParseFile()
* xmlschemas.c: cleanups
* doc/* testapi.c elfgcchack.h: rebuilt to add python bindings
  for the new functions in Schemas.
Daniel
2005-06-15 13:27:56 +00:00
Kasimier T. Buchcik
c63fbbff72 Added xmlSchemaValidateFile() to the public API. This will use SAX2-driven
* xmlschemas.c include/libxml/xmlschemas.h: Added
  xmlSchemaValidateFile() to the public API. This will use
  SAX2-driven validation.
2005-06-15 12:54:05 +00:00
Kasimier T. Buchcik
9ca11bfc3d Some changes/fixes to the streaming evaluation. A bit of support for
* pattern.c: Some changes/fixes to the streaming evaluation.
* xmlschemas.c: A bit of support for parsing the schema for
  schema. Fixed attribute derivation when the use is
  "prohibited" and was "optional". Fixed an attribute construction
  bug, a left-over from the time, where <complexContent>,
  <extension>, etc. where created as structs.
2005-06-14 19:24:47 +00:00
Kasimier T. Buchcik
828f654769 Fixed an attribute fixed/default value constraint error.
* xmlschemas.c result/schemas/include1_0_0.err:
  Fixed an attribute fixed/default value constraint error.
2005-06-09 11:23:39 +00:00
Kasimier T. Buchcik
4efd90d9c3 Changed the validation process to be able to work in streaming mode. Some
* xmlschemas.c xmlschemastypes.c include/libxml/schemasInternals.h
  include/libxml/xmlschemastypes.h: Changed the validation process
  to be able to work in streaming mode. Some datatype fixes,
  especially for list and union types. Due to the changes the
  error report output has changed in most cases. Initial migration to
  functions usable by both, the parser and the validator. This should
  ease a yet-to-come XS construction API in the long term as well.
2005-06-09 10:32:53 +00:00
Kasimier T. Buchcik
bd6c3f7df8 Fixed facet errors to be channelled back for union type members;
* xmlschemas.c: Fixed facet errors to be channelled back for
  union type members; facet-validation will stop now on the
  first error. Reported by GUY Fabrice to the mailing-list.
* xmlschemastypes.c: Changed to ignore lengh-related facet
  validation for QNames and NOTATIONs as proposed by the
  schema people.
* test/schemas/union2* result/schemas/union2*: Added
  regression tests for union types (by GUY Fabrice).
2005-05-25 17:29:36 +00:00
Kasimier T. Buchcik
c0e833f002 Removed 5 unnecessary dereferences (reported by Andriy, bug #301074).
* xmlschemas.c xmlregexp.c: Removed 5 unnecessary
  dereferences (reported by Andriy, bug #301074).
2005-04-19 15:02:20 +00:00
Kasimier T. Buchcik
187ea5f657 Removed workaround for bug #172215, since it does more harm in some
* xmlschemas.c: Removed workaround for bug #172215, since it
  does more harm in some scenarios. Added some of the
  "Particle Restriction OK" constraints - not yet enabled.
2005-04-19 11:25:43 +00:00
Kasimier T. Buchcik
c872afbd82 Added output of canonical values in identity-constraint error messages.
* xmlschemas.c: Added output of canonical values in
  identity-constraint error messages.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaGetCanonValueWhtsp() to the API.
  Further enhancement of the canonical value
  conversion.
* test/schemas/changelog093_0.*: Added test with an XSD
  submitted by Randy J. Ray.
2005-04-18 10:57:04 +00:00
Kasimier T. Buchcik
016d92e30b Added substitution group constraints; changed the build of the
* xmlschemas.c: Added substitution group constraints; changed
  the build of the pre-computed substitution groups. Channeled
  errors during xsi assembling of schemas to the validation
  context. Fixed a big memory leak, which occured when using
  IDCs: the precomputed value of attributes was not freed if
  the attribute did not resolve to an IDC field (discovered
  with the help of Randy J. Ray's schema, posted to the
  xmlschema-dev maling list).
2005-04-08 20:08:40 +00:00
Kasimier T. Buchcik
1a99a39745 Added "Particle correct 2" to parsing of model groups. Added handling
* xmlschemas.c: Added "Particle correct 2" to parsing of model groups.
  Added handling substitution groups inside <choice> and <sequence>;
  for <all> this is not supported yet. Changed circular checks for
  model groups definitions. "memberTypes" are processed at different
  levels now: component resolution first, construction later; this
  goes hand in hand with a global change to handle component
  resolution in a distinct phase. Fixed invalid default values for
  elements to mark the schema as invalid; this just resulted in an
  error report previously, but the schema was handled as valid.
  Separated the assignment of the model groups to referencing
  model group definition references (i.e. particles); this was
  needed to perform the circularity check for model group definitions.
  Added "Element Declaration Properties Correct (e-props-correct)"
  constraints. Separated component resolution for simple/complex
  types.
* include/libxml/schemasInternals.h: Added a flag for substitution
  group heads.
2005-04-08 11:23:56 +00:00
Kasimier T. Buchcik
5e371a048c Added "Type Derivation OK (Complex)" constraints and anchored them in the
* xmlschemas.c: Added "Type Derivation OK (Complex)" constraints
  and anchored them in the "Element Locally Valid (Element)"
  constraints. This restricts the type substitution via "xsi:type".
2005-04-05 15:08:05 +00:00
Daniel Veillard
f35984584e patch from Matthew Burgess to improve some schemas facets validation
* xmlschemas.c: patch from Matthew Burgess to improve some schemas
  facets validation messages.
Daniel
2005-04-05 11:10:45 +00:00
Kasimier T. Buchcik
aba15f7670 Corrected 'length' facet validation for QNames and notations. Corrected
* xmlschemastypes.c: Corrected 'length' facet validation for
  QNames and notations. Corrected xmlSchemaGetCanonValue: some
  data types did not return a value if already in normalized
  form.
* xmlschemas.c include/libxml/schemasInternals.h:
  Eliminated creation of structs for <restriction>, <extension>,
  <simpleContent>, <complexContent>, <list> and <union>: the
  information is now set directly on the corresponding simple/
  complex type. Added some more complex type constraints.
  Added facet derivation constraints. Introduced "particle"
  components, which seem to be really needed if applying
  constraints. Corrected/change some of the parsing functions.
  This is all a bit scary, since a significant change to the code.
* result/schemas/src-element2-*.err result/schemas/element-*.err:
  Adapted regression test results.
2005-04-01 15:17:27 +00:00
Daniel Veillard
5d4644ef6e revamped the elfgcchack.h format to cope with gcc4 change of aliasing
* doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h
  format to cope with gcc4 change of aliasing allowed scopes, had
  to add extra informations to doc/libxml2-api.xml to separate
  the header from the c module source.
* *.c: updated all c library files to add a #define bottom_xxx
  and reimport elfgcchack.h thereafter, and a bit of cleanups.
* doc//* testapi.c: regenerated when rebuilding the API
Daniel
2005-04-01 13:11:58 +00:00
Daniel Veillard
0e460da346 another patch from Brent Hendricks to add new handlers with the various
* python/generator.py python/libxml.py: another patch from Brent
  Hendricks to add new handlers with the various validity contexts
* python/tests/Makefile.am python/tests/validDTD.py
  python/tests/validRNG.py python/tests/validSchemas.py: also
  added the regression tests he provided
Daniel
2005-03-30 22:47:10 +00:00
Kasimier T. Buchcik
53b5e0526f Fixed call to a facet error report: the type of the error was wrong,
* xmlschemas.c: Fixed call to a facet error report: the type of
  the error was wrong, resulting in a segfault (bug #171220, reported
  by GUY Fabrice).
2005-03-24 11:05:13 +00:00
Kasimier T. Buchcik
a62f75f115 Removed a stupid bug in xmlSchemaValidateAttributes, failing to build a
* xmlschemas.c: Removed a stupid bug in xmlSchemaValidateAttributes,
  failing to build a linked list correctly (bug #169898, reported
  by bing song, hmm...).
2005-03-21 22:01:47 +00:00
Kasimier T. Buchcik
b34ad1b676 Fixed a segfault, which occured during bubbling of IDC nodes (bug #170779
* xmlschemas.c: Fixed a segfault, which occured during bubbling
  of IDC nodes (bug #170779 and #170778, reported by GUY Fabrice):
  a variable was missed to be reset in a loop. Deactivated bubbling,
  if not referenced by a keyref.
2005-03-21 20:10:31 +00:00
Kasimier T. Buchcik
289dbb45d9 Removed inheritance of "mixed" content type for short-hand restrictions of
* xmlschemas.c: Removed inheritance of "mixed" content type for
  short-hand restrictions of "anyType" (reported by Guy Fabrice
  to the mailing list). Added the namespace conversion (chameleon
  includes) for the base type reference of <restriction> and
  <extension>.
* test/schemas/bug152470_1.xsd: Adapted due to the above change
  of "mixed" inheritance.
2005-03-17 12:39:31 +00:00
Daniel Veillard
bc69d4f942 fixed a = -> == error pointed by GUY Fabrice Daniel
* xmlschemas.c: fixed a = -> == error pointed by GUY Fabrice
Daniel
2005-03-17 10:04:46 +00:00
Daniel Veillard
cc5e2330ef more debug messages from Matthew Burgess xmlSchemaValidateLengthFacet API
* xmlschemas.c: more debug messages from Matthew Burgess
* xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check.
Daniel
2005-03-16 21:55:35 +00:00
Kasimier T. Buchcik
478d693fa2 Hopefully finished validation against facets to use the normalized value
* xmlschemas.c xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Hopefully finished validation against facets to use the normalized
  value of both, the facets and instance values. Added
  xmlSchemaValidateLengthFacetWhtsp(), xmlSchemaValidateFacetWhtsp()
  and xmlSchemaGetValType() to the schema API.
2005-03-16 16:29:18 +00:00
Daniel Veillard
cffc1c7af1 removed a static buffer in xmlByteConsumed(), as pointed by Ben Maurer,
* encoding.c: removed a static buffer in xmlByteConsumed(),
  as pointed by Ben Maurer, fixes #170086
* xmlschemas.c: remove a potentially uninitialized pointer warning
Daniel
2005-03-12 18:54:55 +00:00
Kasimier T. Buchcik
b474fa409c The schema parser will stop if components could not be resolved. This is
* xmlschemas.c: The schema parser will stop if components could
  not be resolved. This is not conforming to the spec but for now
  will avoid internal errors during type fixup and content model
  creation. Restructured inclusion/import of schemata: this avoids
  duplicate, self and circular inclusion. Chameleon includes are
  still workarounded. Added restriction to disallow references to
  non-imported namespaces. Corrected parsing of <group>.
* result/schemas/bug167754_0_0*: Added a missing test result.
2005-03-11 12:34:42 +00:00
Kasimier T. Buchcik
7f3efa9756 Tiny restructuring of the validation start-up functions. Added cleanup of
* xmlschemas.c: Tiny restructuring of the validation start-up
  functions. Added cleanup of the validation context at the
  end of validation. This takes care of the validation context
  being reused.
2005-03-07 17:41:58 +00:00
Kasimier T. Buchcik
9b77aa0b81 Added IDC validation of anySimpleType attribute values; anyway the IDC key
* xmlschemas.c: Added IDC validation of anySimpleType attribute
  values; anyway the IDC key comparison is restricted to
  anySimpleType <--> string based types. For other types we
  would possibly need the canonical lexical representation of
  them; this sounds not performant, since we would need to
  build such a representation each time we want to compare against
  anySimpleType. TODO: think about buffering the canonical values
  somewhere. Fixed error reports for default attributes to work
  without a node being specified. This all and the enabling of IDC
  validation fixes bug #165346 (reported by Benoit Gr?goire - could
  not read his last name correctly from bugzilla).
2005-03-04 22:04:16 +00:00
Kasimier T. Buchcik
285ebabb07 Enabled IDC parsing and validation. Added xmlSchemaCopyValue to the API;
* xmlschemas.c: Enabled IDC parsing and validation.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaCopyValue to the API; this was done due to
  validation of default attributes against IDCs: since IDC keys
  consume the precomputed value, one needs a copy.
* pattern.c: Enabled IDC support; this is currently done
  via calling xmlPatterncompile with a flag arg of 1.
2005-03-04 18:04:59 +00:00
Kasimier T. Buchcik
ff858ca8e4 Started support for IDC resolution to default attributes. If building the
* xmlschemas.c: Started support for IDC resolution to default
  attributes. If building the content model for <all>: ensured
  to put element declarations and not the particles into the
  content model automaton (this was bug #167754, reported by
  Frans Englich).
2005-02-18 11:37:58 +00:00
Kasimier T. Buchcik
b06b4dede2 Added validation for the attribute "id" in the schemata; doing this needed
* xmlschemas.c: Added validation for the attribute "id" in the
  schemata; doing this needed error report fixes for notations,
  facets and group. Changed NOTATION validation to work with the
  declared NOTATIONs in the schema; this does have no impact on
  the validation via the relaxng module.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaNewNOTATIONValue to the API to be able to do
  the NOTATION validation described above.
* test/schemas/element-err_0.xsd test/schemas/annot-err_0.xsd:
  Fixed the values of the "id" attributes, which were not validated
  previously.
2005-02-17 19:00:23 +00:00
Kasimier T. Buchcik
6e224f1272 Fixed comparison for default/fixed attribute values, if the type was
* xmlschemas.c: Fixed comparison for default/fixed attribute
  values, if the type was 'xsd:string'. Changed the comparison
  for IDCs to use the whitespace aware comparison function.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaGetCanonValue, xmlSchemaNewStringValue and
  xmlSchemaCompareValuesWhtsp to the API. Added functions
  to compare strings with whitespace combinations of "preserve",
  "replace" and "collapse".
2005-02-17 11:10:44 +00:00
Kasimier T. Buchcik
bd2a7d169b Further work on IDCs, especially evaluation for attribute nodes.
* xmlschemas.c: Further work on IDCs, especially evaluation for
  attribute nodes.
2005-02-16 12:27:25 +00:00
Kasimier T. Buchcik
25799cee8d Added IDC evaluation for attribute nodes. Made 'nil'ed elements work.
* xmlschemas.c: Added IDC evaluation for attribute nodes.
  Made 'nil'ed elements work. Added a specific error message
  for 'strict' attribute wildcards.
* include/libxml/xmlerror.h: Added an error code for
  wildcards.
* result/schemas/anyAttr-processContents-err1_0_0.err: Adapted.
2005-02-15 14:39:48 +00:00
Daniel Veillard
e92bf5d6f4 fixed one internal function applied patch from Joel Reed regenerated
* xmlschemas.c: fixed one internal function
* doc/Makefile.am doc/wiki.xsl: applied patch from Joel Reed
* testapi.c doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated
daniel
2005-02-04 17:28:19 +00:00
Kasimier T. Buchcik
0a5985283b Integrated the streaming pattern from the pattern module. Fixed some IDC
* xmlschemas.c: Integrated the streaming pattern from the
  pattern module. Fixed some IDC code bugs. Changed
  fallback for attribute declaration addition to work like for
  element declarations.
2005-01-31 17:02:07 +00:00