Commit Graph

729 Commits

Author SHA1 Message Date
Davide Brunato c5e373dc8c Fix regular expression parsing with forbidden escapes
- \uXXXX and \xXX escapes are not allowed for XSD regex
2019-04-17 19:09:31 +02:00
Davide Brunato 36dbb1a904 Move and fix XsdType.is_derived()
- Method replaced by an abstract method and moved to XsdSimpleType
2019-04-15 18:49:42 +02:00
Thomas Ruster 404de114c2 Fixed issue: backslashes were not properly escaped when creating python regular expressions from xml 2019-04-15 17:50:46 +02:00
Davide Brunato 8f4eaaa46c Fix model group checking
- Refactoring ParticleMixin hierarchy
2019-04-15 13:07:31 +02:00
Davide Brunato e6fd152843 Fix simple restriction checking 2019-04-11 07:09:19 +02:00
Davide Brunato 7b77f6be14 Split XSD group validators from model
- Code cleaning and refactoring in order to complete model verifiers
2019-04-09 16:56:28 +02:00
Davide Brunato 7cbf776dd4 Refine UPA violation check 2019-04-08 07:36:08 +02:00
Davide Brunato 1c1dc6b60f Increase release and update documentation 2019-04-08 07:29:09 +02:00
Davide Brunato 14ac859b33 Write redefinition checking
- Added class attribute redefine=None to XSD types and groups: this
    attribute is ovverridden by instance attribute in case of a redefine
2019-04-07 11:50:22 +02:00
Davide Brunato 4c3ca4b53c Enable skipped schema tests on models 2019-04-06 14:31:06 +02:00
Davide Brunato 54c4297335 Complete complexType models checking 2019-04-05 18:24:09 +02:00
Davide Brunato 58af73dd1b Refine checks on models and restrictions 2019-04-04 09:06:46 +02:00
Davide Brunato 64d21997a5 Additional fixes for checking invalid schemas 2019-03-31 09:35:50 +02:00
Davide Brunato e6d8b4cf55 Add XMLSchemaModelError exception 2019-03-29 16:22:16 +01:00
Davide Brunato c2f5512f0d Fixes for schemas with substitution groups
- Build of substitution groups moved into XsdElement code
2019-03-28 14:08:36 +01: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 d58f8b7130 Add helper function get_xsd_form_attribute() 2019-03-27 15:20:13 +01:00
Davide Brunato b221fa255f Bugfix for attributes and attribute groups 2019-03-27 11:59:22 +01:00
Davide Brunato f96ca2c41c Add XsdGroup.get_groups()
- Fix model checking adding a method to retrieve groups path
    for elements/particles
2019-03-25 07:30:41 +01:00
Davide Brunato b434721a93 Fix deterministic model cheching 2019-03-23 22:50:59 +01:00
Davide Brunato f1427a3335 Fix complex restriction checking
- ParticleMixin.is_restriction() renamed to has_particle_restriction()
2019-03-22 18:17:57 +01:00
Davide Brunato 37595da57c Add model checks after schema build
- Added check on type matching of same elements
  - Added XsdGroup.check_particles() for check Unique Particle Attribution
    Constraint of schema
  - Fixed group redefine (clear in any case when _parse begins)
2019-03-21 07:14:58 +01:00
Davide Brunato c9baf730a5 Integrate W3C tests for invalid schemas
- Fix XsdType.is_derived(other, derivation=None) when the 2nd argument
    is provided (eg. 'extension')
  - Fix XMLSchemaBase._import_namespaces(): set namespace='' in case of
    no namespace and check that it's different from self.target_namespace.
2019-03-19 13:08:14 +01:00
Davide Brunato b01a8579d2 Complete W3C tests with valid schemas for XSD 1.0
- Added XsdElement.get_path()
  - Fixes for XSD types, identities and pattern facets
2019-03-19 10:58:12 +01:00
Davide Brunato 7bc30c9b13 Fix ancestor/descendant constraint for xs:keyref refer 2019-03-15 12:49:10 +01:00
Davide Brunato 15299e450b Fix xpath attribute checking on XSD identities
- Commented out xs:pattern in XSD 1.0 meta-schema for xs:selector
    and xs:field
  - Add a pattern to XsdSelector and XsdFieldSelector for checking
    the xpath value after the removal of all whitespaces
  - Added '::' symbol to XsdIdentityXPathParser
2019-03-15 10:38:16 +01:00
Davide Brunato d4207cd457 Fix the substitution groups build phase
- Select schema's substitution groups instead of the ones of the namespace
2019-03-15 10:26:51 +01:00
Davide Brunato a39ab374e9 Add two include tests with chameleon schema
- Note: chameleon2.xsd is invalid if imported but it's valid if included by a
    schema that has the same target namespace of the unresolved component
2019-03-14 15:53:20 +01:00
Davide Brunato 5917873b7f Add resolve_qname() to XMLSchemaBase
- Replace prefixed_to_qname() with resolve_qname()
  - Code cleaning for helpers.py module
  - Add schema defaults as XMLSchemaBase class attributes
2019-03-14 15:18:28 +01:00
Davide Brunato d0cad5b52b Add compatibility code for Python 2.7
- Typo in codepoints.py for compat chr()
  - Add a fake lru_cache decorator for Python 2.7
2019-03-14 11:41:15 +01:00
Davide Brunato 422380f06e Fix schema's imports and includes
- Now each schema has a dict for imports and a list for includes
  - Argument meta_maps changed with use_meta
  - Added use_meta property
2019-03-13 16:01:14 +01:00
Davide Brunato 7d98ac82a2 Complete package tests with a check on schema files 2019-03-13 07:18:24 +01:00
Davide Brunato 9aaa9f1244 Add post install/develop command for create Unicode categories JSON
- Adding a test for JSON file of Unicode categories
  - Added and renamed test cases for includes and imports
2019-03-13 06:53:10 +01:00
Davide Brunato 037cec1848 Update NamespaceResourcesMap class
- Items are set with a copy in case of a list (real copy)
2019-03-12 07:18:17 +01:00
Davide Brunato 92450894dc Update test scripts
- Now SchemaObserver component is compared against maps components
  - Improved error message for XMLSchemaTestCase.check_errors()
2019-03-12 07:14:41 +01:00
Davide Brunato 953924e35a Update Unicode categories module
- More speed on creating categories from unicodedata.category API
  - JSON serialized Unicode categories now include major categories
  - Delete unicode_categories.json from repo (it will be created by
    install command)
2019-03-12 07:08:10 +01:00
Davide Brunato 2671d90aa3 Fix listing of errors and lookup errors representation
- Refine iter_components for schemas: now filter the globals that
    don't belong to the schema (same namespace but different schemas)
  - Cleaned XsdGlobals.all_errors property
2019-03-11 22:00:32 +01:00
Davide Brunato 36ba3c37fe Add tests for schema includes (new section test_cases/features/namespaces/) 2019-03-11 21:53:23 +01:00
Davide Brunato 9cf8e25a36 Fix hexBinary and base64Binary validators ('' is a valid value) 2019-03-11 11:42:51 +01:00
Davide Brunato cb255c44ef Remove max_value and min_value typos from XsdSimpleType._parse_facets() 2019-03-11 11:24:48 +01:00
Davide Brunato 2aa5ed0037 Fix schema 'built' property
- Added a last chance check for schemas that have no globals
    defined
  - Added XsdGlobals.lookup()
2019-03-11 10:49:19 +01:00
Davide Brunato 75a1356778 Add XMLSchemaBase.create_meta_schema() class method
- Replace equivalent code in XMLSchemaMeta
  - Used by XsdGlobals to replace meta schema in case of import of
    a base-schema namespace (XSD, XSI, XML, XLINK, HFP)
  - Added meta_maps argument to XMLSchemaBase
2019-03-11 07:03:40 +01:00
Davide Brunato 5ca74c769e Continuing W3C tests integration
- Passed first 4817 valid schemas tests
2019-03-09 10:05:19 +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 069146fd22 Integrating with W3C test suite
- Fix the decoding of attributes with a default value
  - Fix parse of the element type
  - Fix parse of the element block attribute
2019-03-06 17:09:16 +01:00
Davide Brunato bb9ca2284a Fix schema initialization
- Namespaces set before any possible parse error
2019-03-06 15:14:15 +01:00
Davide Brunato 63c95dbc18 Add schema_url and origin_url properties to XMLSchemaValidatorError
- New properties used in parse errors representation
2019-03-06 11:12:21 +01:00
Davide Brunato 8d7e6d162c Fix error collecting for XsdGlobals
- Added a custom property all_errors that iterates on schemas
  - Fix counting of total errors in test_schemas.py
2019-03-06 10:08:21 +01:00
Davide Brunato ff78b9a44a Add 'msg' property to XMLSchemaValidatorError 2019-03-05 17:53:49 +01:00
Davide Brunato e55dfde69c Add min_value e max_value properties to XsdSimpleType
- Fix the checking of min/max value facets
2019-03-05 10:11:20 +01:00