Commit Graph

42 Commits

Author SHA1 Message Date
Davide Brunato 690a172502 Add logging for schema initialization and building
- Add loglevel argument to schema init
  - Fallback location (for XLink and XHTML) moved at the
    end of import tentatives (full fix for issue #137)
  - Fix TestGlobalMaps after the remove of XLink from base schemas
2019-10-08 11:30:36 +02:00
Davide Brunato 0480e4bee8 Add is_override() to XsdComponent for XSD 1.1 schemas
- Change is_global() from property to function
2019-09-19 06:37:42 +02:00
Davide Brunato e6e009386a Fix library tests
- Fixed etree encoding checks for py2
  - Fixed XSD 1.1 meta-schema restriction checking
  - Set memory lazy tests to higher level (something
    changed after lazy meta-schema build, need to be
    checked with large XML files)
2019-08-20 22:10:12 +02:00
Davide Brunato 3ff9e8b010 Add openContent override to include notQName
- Replace list_builtins.xsd with xsd11-extra.xsd
2019-08-10 23:59:38 +02:00
Davide Brunato f2a30baf32 Fix XSD 1.1 bugs with W3C XML Schema suite 2019-08-01 17:16:12 +02:00
Davide Brunato df5c454b24 Add minimal schema for versioning namespace
- Added XMLSchemaNamespaceError for namespace related errors
  - version_check moved to schema class
  - resolve_qname() now raises KeyError if namespace prefix is not found
  - resolve_qname() now raises XMLSchemaNamespaceError if a namespace
    is mapped with a prefix but is not loaded by an import
2019-08-01 07:03:03 +02:00
Davide Brunato dcf264eaf1 Code cleaning on some test scripts 2019-07-02 21:41:03 +02:00
Davide Brunato 7d20e8eff1 Add tests for meta-schema and add XMLSchema11 to package base
- Build meta-schema when is used for validation/decode/encode
    or the builtin-types() accessor is used
  - Add clear() method to XMLSchema base class
2019-06-27 10:48:25 +02:00
Davide Brunato 85cdd364ad Fix facets for XSD builtin types
- Added facets to numerical XSD builtins but keep validator functions
  - More checks on min/max value facets
  - Removed HFP namespace from base schemas (used only for meta-schema wildcars)
2019-03-28 07:26:36 +01:00
Davide Brunato 84f6e33c51 Update XSD 1.0 meta-schema to 2nd edition version 2019-03-07 10:02:05 +01:00
Davide Brunato 5f10fe67a7 Code cleaning of test scripts
- Removed old code of xmlschema imports
  - Test header enriched with Python version and platform
2019-01-31 22:09:18 +01:00
Davide Brunato b8b31f95ca Remove old XSD datetime types validators
- Add test subclass TestDecoding11
  - Remove unused regex patterns related to datetime types
2019-01-20 22:59:23 +01:00
Davide Brunato b08139ea67 Update requirements and spilt XSD 1.0 and 1.1 built-in types
- requires elementpath >= 1.1.1
   - eg. XSD 1.0 dates use Date10 that not allows year 0000
2019-01-20 18:14:06 +01:00
Davide Brunato 9d6b88baae Change copyright years info 2019-01-20 16:56:10 +01:00
Davide Brunato 34c3f8a326 Added a base schema for creating XSD 1.1 list builtin types
- Set different BASE_SCHEMAS for XMLSchema10 and XMLSchema11
  - XMLSchemaMeta now uses include for XSD namespace base schemas
2018-10-30 18:15:23 +01:00
Davide Brunato d07e5c9a0d Fix for issue #88
- The issue was related to recursive complexType
  - Added a test to XsdGroup.iter_components to skip iteration
    of inherited items of an XsdComplexType instance
  - XsdGroup.built refactored, adding also the same test added to
    XsdGroup.iter_components
2018-10-29 07:24:10 +01:00
Davide Brunato 9d393fbc81 Complete the tests for XSD 1.1 builtin types
- Update CHANGELOG.rst for releasing
2018-10-21 08:10:52 +02:00
Davide Brunato 9a3329dfbe Fix builtin types for XSD 1.1
- Added dayTimeDuration and yearMonthDuration
  - Split XSD 1.0 and XSD 1.1 builtins and tests
2018-10-20 16:31:55 +02:00
Davide Brunato 3c7e4d2577 Fix for issue #85 2018-10-18 19:05:29 +02:00
Davide Brunato 7866437f8e Add XSD 1.1 builtin types 2018-10-10 07:17:48 +02:00
Davide Brunato ea16244f4d Add 'parent' attribute to XsdComponent classes
- Attribute 'is_global' turned to a property
  - XSD builtins creation rewritten and simplyfied
2018-08-08 17:23:20 +02:00
Davide Brunato dfbde5ec53 Fix for issue #59
- XSD group references are not expanded anymore: only a reference
    to the global group is saved.
  - Added a billion laugh model test to prove that issue #59 does not
    happens with those changes.
  - Schema's base_elements dictionary removed from global maps and
    transformed to a lazy property for schema classes.
2018-05-03 10:35:39 +02:00
Davide Brunato cef2fa22ee Some bugfix
- Fix for issue #41, workaround for issue #44
  - Fix for built property for schema class
  - Fix for final attribute usage for complexType
2018-02-15 21:15:47 +01:00
Davide Brunato d56208106b Update test scripts
- add setUpClass() method to test classes
  - XMLSchemaTestCase class removed
  - common test definitions are now in xmlschema/tests/__init__.py
  - xmlschema/tests/_test_common.py deleted
2018-01-09 10:52:39 +01:00
Davide Brunato 43d0c77eee Fixed bug #34, updated copyright information. 2018-01-08 09:15:09 +01:00
Davide Brunato 010e21ad10 Saving experimental code before cleaning:
- Save some test functions for unicode data parse
  - Moved TestUnicodeCategories from test_meta.py to test_regex.py
2017-12-21 15:05:47 +01:00
Davide Brunato 094caa146e Some refactoring and bug fixes.
- Fixed issues #28 and #29
  - Code cleaning
  - Created a "validators" subpackage that includes schemas, xsd global
    maps and all the XSD components
  - Added "prefixed_name" property to XsdComponent class
2017-12-15 15:56:07 +01:00
Davide Brunato 8ad6c45d7f Improved tests and bugfix:
- Rewritten test scripts to use unitest standard interface
  - Added a SchemaObserver class for impoving schema inspection
  - Fixed a bug in component iter_errors() method
  - Added validators and tests for date and time XSD builtins
  - Documentation examples updated with Python 3
2017-11-23 10:03:53 +01:00
Davide Brunato 161553b20f Tests improving and bugfix:
- Rewritten imports and use a common factory function for tests
  - Fixed an unclosed urlopen into function get_xml_root of
    xmlschema/resource.py module
2017-11-18 22:17:20 +01:00
Davide Brunato f788c0a00e Improving tests and bugfix of issue #22. 2017-11-17 14:41:44 +01:00
Davide Brunato 7e91aa1f1d Revising tests 2017-11-05 08:38:14 +01:00
Davide Brunato fd81691585 Bugfix release v0.9.13:
* Fixed issues #17, #18, #20
  * Fixed test case examples/derivations/complex-extensions.xsd
2017-10-12 09:35:48 +02:00
Davide Brunato 6e992aab09 Fixed some bugs, code cleaning:
* Fixes for bugs #14, #15, #16
  * Removed unused module xmlschema/etree.py
  * Added tests for URLs processing (test URL normalization)
  * Updated licence information (added "-2017")
2017-09-14 13:31:02 +02:00
Davide Brunato 116e429ec5 Some bugfix and code cleaning:
* fixed a bug in simpleContent restriction parsing for attributes
  * code cleaning for schemas and resources
  * XMLSchema's 'uri' attribute changed to 'url'
  * created fetch_resource(), normalize_url() and get_xml_root() in
    resources.py, in order to start an improvement of XML parsing
2017-07-12 14:05:27 +02:00
Davide Brunato b0bad64b54 Restructured the XSD class hierarchy:
* Created a XsdBaseComponent, used both for schemas and
    for XSD components
  * ValidatorMixin replaces XMLSchemaValidator
  * XsdComponent is now the base class of all XSD components
  * new class XsdAnnotated
  * Token based checks removed (the 'built' property is pretty
    fast and safe)
2017-07-07 18:16:14 +02:00
Davide Brunato 1d037531a2 Unused code removed and added a CHANGELOG:
* removed factories.py
  * removed XsdComponent.parent attribute (not fully implemented,
    not sure if it's really useful, maybe for the future)
2017-07-05 15:36:32 +02:00
Davide Brunato bd38d2c798 Tested with all schemas: some errors and to slow. 2017-07-04 16:14:26 +02:00
Davide Brunato 174ed7051b Move of factories's code to XSD components completed. 2017-07-03 15:30:36 +02:00
Davide Brunato 5deb2f8fbe Full built and validity checks for schemas and components:
* Removed XsdGlobals.get_globals(), replaced by NamespaceView,
    a Mapping subclass that emulate a dictionary;
  * Implemented a check_status for fully checking of schema
    components, avoiding circularity;
  * Building of XSD components improved, avoiding circularity with
    the lazy building of XsdElement instances in the groups.
2017-06-28 13:23:22 +02:00
Davide Brunato d090df9fa3 Improved XPath parser and testing:
* Added test files for decoder (examples/decoder/*);
  * Added a variant of test schema vehicles.xsd (examples/vehicles/vehicles2.xsd);
  * Added XPath filter predicates;
  * Fixed empty dict decoding to None (issue #4).
2017-05-15 08:06:32 +02:00
Davide Brunato 81b2171e7f Fixed a bug and improved namespace declaration views:
* Bugfix for whiteSpace='collapse' in normalize function;
  * Added a cache for global maps views;
  * The views for each namespace are mapped from local names.
2017-05-06 15:18:54 +02:00
Davide Brunato 7cdf245496 Improved the processing of XML Schema regular expressions:
- Fixed patterns validation calls
  - Improved the regex translation
  - Fixed Unicode literals representation
  - Added testfiles for patterns
2017-03-22 11:30:27 +01:00