1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00
Commit Graph

77 Commits

Author SHA1 Message Date
Remi Gacogne
4609e6c980 XSD: optional element in complex type extension
For https://bugzilla.gnome.org/show_bug.cgi?id=609796
Libxml2 fails to validate an instance document against a schema if an element
whose type is a complex extension of some base type with an optional child
element and that child element is not specified in the instance document.  For
example, suppose I have some complex type BaseType that is defined to have one
child element in a sequence group that has minOccurs set to 0
2012-05-11 15:31:05 +08:00
Daniel Veillard
4013e83e84 579746 XSD validation not correct / nilable groups
* xmlschemas.c: when a particle need to be processed via counted
  transition, if the group is nillable, the counting won't work, so
  keep track of nillable subset as they are built and generate the
  appropriate epsilon transitions as needed
* test/schemas/579746* result/schemas/579746*: add related test cases
  based on the bug report
2009-08-26 17:24:31 +02:00
Daniel Veillard
d80d0728bf 559410 - Regexp bug on (...)? constructs
* xmlregexp.c: fix a regexp bug on some (...)? constructs
* test/schemas/nvdcve* result/schemas/nvdcve*: add the tests to the
  regression suite
2009-08-22 18:56:01 +02:00
Daniel Veillard
be390ed0a1 Test case for 570702 2009-08-12 12:40:39 +02:00
Jason Childs
edc68aadf8 582906 XSD validating multiple imports of the same schema
* xmlschemas.c: When validating a schema that includes the same file
  that has no targetNamespace defined an internal erro was thrown,
  depending on the orig namespace that should be allowed though
* test/schemas/582906-* result/schemas/582906-*: 2 tests case, one
  where this is allowed, and one where this is forbidden
2009-08-07 20:29:33 +02:00
Jason Childs
d996072077 Bug 582887 – problems validating complex schemas
* xmlschemas.c: fixes the problem faced when importing the same schemas
  multiple times but from different places which is allowed
* test/schemas/582887* result/schemas/582887*: adding the specific test
  to the regressions
2009-08-07 19:01:32 +02:00
Daniel Veillard
bf9c1dad3a add the testchar to 'make check' Volker Grabsch pointed out a typo
* Makefile.am: add the testchar to 'make check'
* xmlschemas.c: Volker Grabsch pointed out a typo
* xmlregexp.c: production [19] from XML Schemas regexps were a
  mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch
  provided a patch to remove it
* test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd
  test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0
  result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided
  regession tests for this
Daniel

svn path=/trunk/; revision=3776
2008-08-26 07:46:42 +00:00
Daniel Veillard
041b687e93 apply patch from Andrew Tosh to fix behaviour when '.' is used in a
* xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
  when '.' is used in a posCharGroup
* test/schemas/poschargrp0_0.* result/schemas/poschargrp0_0_0*:
  added the test to the regression suite
Daniel

svn path=/trunk/; revision=3687
2008-02-08 10:37:18 +00:00
Daniel Veillard
3888f47263 applied patch from Frank Gross fixing Schemas IDC import bug #455953 and
* xmlschemas.c test/schemas/*455953* result/schemas/bug455953*:
  applied patch from Frank Gross fixing Schemas IDC import bug
  #455953 and also add the test to the regression suite
Daniel

svn path=/trunk/; revision=3652
2007-08-23 09:29:03 +00:00
Kasimier T. Buchcik
92b394fcf3 Fixed bug #341150, reported by Michael Romer. In
* xmlschemas.c: Fixed bug #341150, reported by Michael Romer.
  In xmlSchemaBuildContentModelForSubstGroup(),
  xmlAutomataNewOnceTrans2() was incorrectly used instead of
  xmlAutomataNewTransition2() to mimic a xs:choice for
  substitution-groups.
* test/schemas/subst-group-1_1.xsd
  test/schemas/subst-group-1_0.xml
  result/schemas/subst-group-1_0_1
  result/schemas/subst-group-1_0_1.err: Added regression test
  supplied by Michael Romer for bug #341150.
2006-05-09 19:59:54 +00:00
Kasimier T. Buchcik
b63d2fab2d Fixed incorrect validation of restricted enumerations. Added related
* xmlschemas.c test/schemas/restriction-enum-1*
  result/schemas/restriction-enum-1*: Fixed incorrect
  validation of restricted enumerations. Added related
  regression tests.
2006-04-19 11:20:49 +00:00
Kasimier T. Buchcik
b0d74c661a Added regression test for bug #321475 (reported by Gabor Nagy). Fixing of
* test/schemas/bug321475* result/schemas/bug321475*:
  Added regression test for bug #321475 (reported by
  Gabor Nagy). Fixing of bug #323510 seemed to have
  fixed this bug as well.
2005-12-13 11:52:35 +00:00
Kasimier T. Buchcik
183fa3e79a Added regression test for bug #323510.
* test/schemas/bug323510* result/schemas/bug323510*:
  Added regression test for bug #323510.
2005-12-12 15:20:28 +00:00
Kasimier T. Buchcik
bf442eb243 Added regression tests for the latest IDC and xs:decimal bugs.
* test/schemas/decimal* test/schemas/bug322411*: Added
  regression tests for the latest IDC and xs:decimal bugs.
2005-11-30 11:24:18 +00:00
Kasimier T. Buchcik
77e76829b6 Changed xmlSchemaFormatIDCKeySequence() to use
* xmlschemas.c: Changed xmlSchemaFormatIDCKeySequence()
  to use xmlSchemaGetCanonValueWhtspExt() in order to
  correctly report values for xs:anySimpleType.
* test/schemas/idc-keyref-err1*
  result/schemas/idc-keyref-err1*: Added a test for this change.
2005-11-11 12:52:32 +00:00
Kasimier T. Buchcik
91b2314354 And adapting another one.
* test/schemas/import1_0.xsd: And adapting another one.
2005-09-12 19:44:00 +00:00
Daniel Veillard
4f917e2416 applied patch from Kuba Nowakowski fixing bug #313982 also added the test
* xmlschemastypes.c: applied patch from Kuba Nowakowski fixing bug
  #313982
* result/schemas/bug313982* test/schemas/bug313982*: also added
  the test case to the regression suite.
Daniel
2005-08-22 16:01:43 +00:00
Kasimier T. Buchcik
76d73f5bc5 Added some more tests for element wildcards.
* test/schemas/any7_2.xml test/schemas/any6_2.xsd
  test/schemas/any8_1.xsd test/schemas/any8_0.xml:
  Added some more tests for element wildcards.
2005-08-09 13:56:25 +00:00
Kasimier T. Buchcik
800cbac34e Fixed #312957 reported by Carol Hunter: streaming XPath states were not
* xmlschemas.c: Fixed #312957 reported by Carol Hunter:
  streaming XPath states were not popped in every case,
  thus failed to resolve correctly for subsequent input.
* test/schemas/bug312957* result/schemas/bug312957*:
  Added the test submitted by Carol Hunter.
2005-08-09 12:31:55 +00:00
Daniel Veillard
6e65e15777 trying to nail down the remaining ##other issues completed the tests and
* xmlregexp.c xmlschemas.c: trying to nail down the remaining
  ##other issues
* result/schemas/any7* test/schemas/any7: completed the tests
  and added the results
* result/schemas/any3_0_0.err result/schemas/any5_0_0.err
  result/schemas/any5_1_0.err: this slightly chnages the output
  from 3 existing tests
Daniel
2005-08-09 11:09:52 +00:00
Daniel Veillard
10752284e3 fixed bug #310264, basically it's about reentrancy of count based
* xmlregexp.c: fixed bug #310264, basically it's about reentrancy
  of count based transition, when going though the counter must
  be reset to 0
* test/schemas/bug310264* result/schemas/bug310264*: added the
  regression test.
Daniel
2005-08-08 13:05:13 +00:00
Kasimier T. Buchcik
11162b7ce7 Added creation of the content type of xs:anyType. This is needed when
* xmlschemastypes.c: Added creation of the content type of
  xs:anyType. This is needed when trying to extend xs:anyType
  (although it makes no sense to extend it; IMHO the schema
  people should have ruled this out). This was reported
  by Yong Chen to the mailing list.
* xmlschemas.c: Fixed handling of xs:anyType in
  xmlSchemaCheckCOSCTExtends() (reported by Young Chen). Tiny
  adjustment to an error report output.
* test/schemas/extension2* result/schemas/extension2*:
  Added a test case provided by Young Chen.
2005-07-28 00:50:22 +00:00
Kasimier T. Buchcik
5c68274c86 Added regression tests (they fail currently), but did not added results
* test/schemas/any6* test/schemas/any7*: Added regression tests
  (they fail currently), but did not added results yet.
2005-07-23 21:28:30 +00:00
Daniel Veillard
9efc476bb6 fixing bug #172215 about foreign namespaces by adding support for negated
* xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: fixing
  bug #172215 about foreign namespaces by adding support for
  negated string transitions. Error messages still need to be
  improved.
* test/schemas/any5* result/schemas/any5*: adding regression
  tests for this.
Daniel
2005-07-19 14:33:55 +00:00
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
Kasimier T. Buchcik
6d30ff2c08 Fixed bug #309338, reported by Kupriyanov Anotolij. Added a regression
* xmlschemastypes.c: Fixed bug #309338, reported by Kupriyanov
  Anotolij.
* test/schemas/bug309338* result/schemas/bug309338*:
  Added a regression test for the above bug.
2005-07-06 11:44:51 +00:00
Kasimier T. Buchcik
21edf9b42c Added regression tests (from Dhyanesh).
* test/schemas/empty-value* result/schemas/empty-value*:
  Added regression tests (from Dhyanesh).
2005-06-21 08:46:25 +00:00
Kasimier T. Buchcik
8cd0903f9f Added schema tests submitted by Tom Browder (bug #306806).
* test/schemas/bug306806_1.xsd test/schemas/bug306806_0.xml:
  Added schema tests submitted by Tom Browder (bug #306806).
2005-06-15 09:11:00 +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
3eec790cdc Added regression a test provided by Heiko Oberdiek (bug #303566).
* test/schemas/bug303566_1* result/schemas/bug303566_1_1*:
  Added regression a test provided by Heiko Oberdiek (bug #303566).

  level for XML Schema IDCs (bug #303566 reported by Heiko Oberdiek).
  This should not affect pattern-like resolution on every level.
2005-05-10 09:16:19 +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
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
Kasimier T. Buchcik
ba70cc0de7 Changed xmlSearchNsByHref to call xmlNsInScope with the prefix instead of
* tree.c: Changed xmlSearchNsByHref to call xmlNsInScope with
  the prefix instead of the namespace name.
* test/schemas/annot-err_0.xsd test/schemas/element-err_0.xsd:
  Adapted invalid values of the "id" attribute, since they are
  validated now.
2005-02-28 10:28:21 +00:00
Kasimier T. Buchcik
0c34776789 Added the regression test of Frans Englich for bug #167754.
* test/schemas/bug167754_0*: Added the regression test of Frans
  Englich for bug #167754.
2005-02-18 11:47:38 +00:00
Kasimier T. Buchcik
87876407ce Parsing of <complexContent> - handle attribute 'mixed', catch illegal
* xmlschemas.c include/libxml/xmlerror.h include/libxml/xmlschemas.h
  include/libxml/schemasInternals.h: Parsing of <complexContent>
  - handle attribute 'mixed', catch illegal attributes.
  Parsing of <complexType> - handle attributes 'abstract',
  'final' and 'block', catch illegal attributes.
  Validation of complex types - handle abstract types.
  Added handling of default/fixed attributes and element values.
  Per validation option attribute nodes/text nodes are created
  on the instance.
  Added the corresponding constraints for fixed/default.
  Added xmlSchemaSetValidOptions, xmlSchemaGetValidOptions
  to the external API.
  Extended element declaration constraints.
  Got rid of perseverative creation of temporery validation/parser
  contexts.
  Added handling of xsi:schemaLocation and
  xsi:noNamespaceSchemaLocation.
  Fixed xsi:type component resolution if using non-prefixed
  QNames.
* xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h:
  Enabled namespace awareness of the content model if using the
  model group "all".
* test/schemas/bug152470_1.xsd: Removed an "abstract" attribute,
  which broke the test.
* xstc/xstc.py:  Workaround to accomodate case insensitive
  test definitions in ms-test.def.xml (was missing in a previous
  commit).
2004-09-29 13:29:03 +00:00
Kasimier T. Buchcik
876a6db193 Simpified attribute wildcard creation and assignment to get rid of memory
* xmlschemas.c include/libxml/schemasInternals.h
  test/schemas/bug152470_1.* result/schemas/bug152470_1_1*:
  Simpified attribute wildcard creation and assignment to get rid
  of memory leaks.
  Restructured the validation process.
  Restructured and expanded parsing of <attributeGroup>.
  Added initial handing of xsi:type.
  Advanced handling of xsi:nil (should work now for simple types).
  Added construction of schemata using xsi:schemaLocation and
  xsi:noNamespaceSchemaLocation; this is not enabled, since
  no corresponding API exists yet.
  Moved the content model to complex type components.
  Resolution of types for attributes will look for simple types
  only (incl. all the built-in simple types).
  Extended parsing of 'anyAttribute'.
  Fixed content-type type for complex types if derived from
  'anyType' using the short-hand form (see bug # 152470,
  submitted by Thilo Jeremias).
* include/libxml/xmlschematypes.h: Cleaned up some comments.
* xstc/xstc.py: Workaround to accomodate case insensitive
  test definitions in ms-test.def.xml.
* result/schemas/deter0_0_0.err result/schemas/ns0_0_2.err
  result/schemas/ns0_1_2.err: Adapted.
2004-09-16 11:31:52 +00:00
Daniel Veillard
f34a20e69d "" is a valid hexbinary string dixit xmlschema-dev update the test. added
* xmlschemastypes.c: "" is a valid hexbinary string dixit xmlschema-dev
* result/schemas/hexbinary_0_1.err test/schemas/hexbinary_1.xml:
  update the test.
* test/ns5 result//ns5*: added a test for the namespace bug fixed
  in previous commit.
* Makefile.am: added a message in the regression tests
Daniel
2004-08-31 08:42:17 +00:00
Kasimier T. Buchcik
bea2354a33 Added missing test file. Substituted the obsolete xmlSchemaValidError(s)
* test/schemas/import-bad-1_0.imp: Added missing test file.
* xmlschemas.c include/libxml/xmlerror.h include/libxml/xmlschemas.h:
  Substituted the obsolete xmlSchemaValidError(s) for xmlParserErrors
  - see #150840.
  Changed the import of schemas to allow failure of location
  of a resource to be imported.
* result/schemas/all_* result/schemas/any3_0_0.err
  result/schemas/choice_* result/schemas/import1_0_0.err
  result/schemas/list0_0_1.err result/schemas/list0_1_0.err
  result/schemas/list0_1_1.err result/schemas/ns0_0_2.err
  result/schemas/ns0_1_2.err: Adapted regression test results.
2004-08-25 20:35:45 +00:00
William M. Brack
2f2a66324d modified parsing of <list>, <union>, <restriction>, <sequence>, <choice>,
* xmlschemas.c: modified parsing of <list>, <union>, <restriction>,
  <sequence>, <choice>, <include>, <import>.
  Fixed schema defaults (elementFormDefault, etc.) for included
  schemas.
  Fixed a bug which reported attributes as invalid on
  elements declarations with the built-in type 'anyType'.
  Added "lax" validation of the content of elements of type
  'anyType'.
  Fixed: element declarations with the same name were treated
  as duplicate if located in the subtree of <choice> -> <sequence>.
  (This was bug 150623, submitted by Roland Lezuo)
  Fixed cleanup of error codes in xmlSchemaValidateDoc as proposed
  by Igor Kapitanker. (This was bug 150647, submitted by Igor
  Kapitanker)
* xmlschemastypes.c: Changed the type of anyType to
  XML_SCHEMAS_ANYTYPE.
* include/libxml/xmlerror.h: Added schema parser errors.
* result/schemas/bug145246_0_0*
  result/schemas/extension1_0_2.err: Changed test results.
* result/schemas/ct-sc-nobase_0_0*
  result/schemas/facet-whiteSpace_0_0*
  result/schemas/import1_0_0* result/schemas/import2_0_0*
  result/schemas/include2_0_0* result/schemas/include3_0_0*
  result/schemas/restriction-attr1_0_0*
  result/schemas/seq-dubl-elem1_0_0*
  result/schemas/xsd-list-itemType_0_0*: Added new rest results.
  test/schemas/bug145246.xsd.imp test/schemas/ct-sc-nobase_0*
  test/schemas/facet-whiteSpace_0* test/schemas/import1_0*
  test/schemas/import2_0* test/schemas/include2_0*
  test/schemas/include3_0* test/schemas/restriction-attr1_0*
  test/schemas/seq-dubl-elem1_0* test/schemas/xml.xsd
  test/schemas/xsd-list-itemType_0*: Added new tests and missing
  files.
2004-08-20 23:09:47 +00:00
Daniel Veillard
c0826a7709 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
2004-08-10 14:17:33 +00:00
Daniel Veillard
485f26ff5a Added missing file, corrected output, Daniel 2004-06-29 17:07:01 +00:00
Daniel Veillard
01fa6156e5 applied Schemas patches from Kasimier Buchcik, there is still one open
* xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h
  include/libxml/schemasInternals.h include/libxml/xmlschemastypes.h:
  applied Schemas patches from Kasimier Buchcik, there is still
  one open issue about referencing freed memory.
* test/schemas/* result/schemas/*: updated with new tests from
  Kasimier
Daniel
2004-06-29 17:04:39 +00:00
Daniel Veillard
50355f0041 applied another patch from Kasimier Buchcik for Schema Component
* xmlschemas.c include/libxml/xmlerror.h: applied another patch
  from Kasimier Buchcik for Schema Component Constraints
* test/schemas/* result/schemas/*: added the regression tests
Daniel
2004-06-08 17:52:16 +00:00
Daniel Veillard
8839938822 added a bunch of tests from Kasimier Buchcik posted on May 11 Daniel
* test/schemas/* result/schemas/*: added a bunch of tests from
  Kasimier Buchcik posted on May 11
Daniel
2004-06-04 09:29:37 +00:00
Daniel Veillard
8acdfbf53c new patch from Kasimier Buchcik for processContents of wildcards attribute
* xmlschemas.c: new patch from  Kasimier Buchcik for processContents
  of wildcards attribute handling
* test/schemas/anyAttr-* result/schemas/anyAttr-*: added specific
  regression tests
Daniel
2004-06-03 16:00:59 +00:00
Daniel Veillard
3646d6463d applied a patch from Kasimier Buchcik implementing attribute uses and
* xmlschemas.c include/libxml/schemasInternals.h
  include/libxml/xmlerror.h: applied a patch from Kasimier Buchcik
  implementing attribute uses and wildcards.
* test/schemas/* result/schemas/*: added/fixed a bunch of tests
Daniel
2004-06-02 19:19:14 +00:00
Daniel Veillard
669adfcd3a applied a patch from Charles Bozeman fixing a side effect in date handling
* test/schemas/date_0.xml xmlschemastypes.c: applied a patch from
  Charles Bozeman fixing a side effect in date handling
Daniel
2004-05-29 20:12:46 +00:00
William M. Brack
e709195e35 Applied patches supplied by Kasimier Buchcik. changed test to account for
* xmlschemas.c, include/libxml/schemasInternals.h,
  include/libxml/xmlerror.h: Applied patches supplied by
  Kasimier Buchcik.
* test/schemas/po1_0.xml, test/schemas/po1_0.xsd:
  changed test to account for above patch.
2004-05-11 15:09:58 +00:00
Daniel Veillard
c85d0fec52 applied patches from Kasimier Buchcik for the attribute use support added
* xmlschemas.c include/libxml/schemasInternals.h
  include/libxml/xmlerror.h: applied patches from Kasimier Buchcik
  for the attribute use support
* test/schemas/attruse* result/schemas/attruse*: added the
  tests to the regression suite.
Daniel
2004-04-16 16:46:51 +00:00
Daniel Veillard
377e1a9059 move the TODO as comments as the function while not finished are usable
* xmlsave.c: move the TODO as comments as the function while not
  finished are usable as-is
* xmlschemas.c include/libxml/xmlerror.h: patch from Kasimier Buchcik
  implementing union
* test/schemas/union_0_0.x* result/schemas/union_0_0*: added example
* python/Makefile.am: applied fix from Mike Hommey
Daniel
2004-04-16 16:30:05 +00:00