Commit Graph

43 Commits

Author SHA1 Message Date
Davide Brunato df939b9cea Fix xs:alternative and xs:keyref referefence building 2019-08-28 15:56:31 +02:00
Davide Brunato 6994da5173 Code refactoring for tests
- Rename XMLSchemaTestCase to XsdValidatorTestCase
  - Add casepath() helper
  - Modify TestResources: derive from TestCase and use casepath()
  - Split test_package.py into 3 modules (added test_etree.py and
    test_memory.py)
  - Update .tox with new environments 'package' and 'memory'
  - Replace test_package with test_etree into test_all.py script
  - Modify XsdValidatorTestCase.check_schema() to use xs prefix for
    XSD namespace and no namespace as targetNamespace for a fast
    reuse of common and user sample cases
2019-06-20 15:35:04 +02:00
Davide Brunato 75e547abe5 Start development of release v1.0.13 2019-06-19 17:05:41 +02:00
Davide Brunato 3d5c7ee110 Start next release development
- Update release to v1.0.12
  - Add XsdDefaultOpenContent subclass
  - Fix openContent parsing in complex types
2019-05-09 11:04:50 +02:00
Davide Brunato 1c1dc6b60f Increase release and update documentation 2019-04-08 07:29:09 +02:00
Davide Brunato 13a5f5371c Parse of XSD 1.1 targetNamespace of elements and attributes
- Added XsdComponent._parse_target_namespace()
2019-02-07 23:10:31 +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 9d6b88baae Change copyright years info 2019-01-20 16:56:10 +01:00
Davide Brunato c0e2bbdec5 Add assertion facet
- Added XsdAssertionsFacet: based on MutableSequence like XsdPatternsFacet
  - Fixed a typo in XsdPatternsFacet.__setitem__
  - Started development of release v1.0.7
2018-10-23 11:24:38 +02:00
Davide Brunato 35685c5964 Start development of release v1.0.6
- Added test slots for parse helper functions
2018-09-28 19:09:10 +02:00
Davide Brunato 717d467bc5 Start release v1.0.5 and fix for issue #82 2018-09-25 17:52:44 +02:00
Davide Brunato fe3078a3c7 Implement a new iter_decode method based on XsdModelVisitor 2018-09-08 11:19:51 +02:00
Davide Brunato 07d6071db1 Remove intermediate class XsdDeclaration
- Restore old XSD class structure for emerged problems with Py34
    serialization of TEI schema
  - Started the development of release 1.0.3
2018-07-26 23:31:59 +02:00
Davide Brunato e967aa6db8 Use pathlib for checking resource URLs 2018-07-18 11:30:13 +02:00
Davide Brunato 0af5307e6c Fix path normalization for Windows platform 2018-07-14 15:52:03 +02:00
Davide Brunato 7d006d670d Update changelog with release dates and code cleaning 2018-06-27 16:29:59 +02:00
Davide Brunato fb24068ebe Fix schema serialization and update version
- Modified CHANGELOG.rst
  - Lookup functions rewritten and bound to global names for serialization
  - Dependancy: elementpath minimal version now is 1.0.10
2018-06-15 18:39:52 +02:00
Davide Brunato a3ca8bba9d Switch to new release 0.9.30
- Fix for issue #66
  - Schema tests cleaning (moving some tests to test_schemas.py script)
  - Removing some old test files
2018-06-06 14:11:39 +02:00
Davide Brunato 9429759f98 Modify tests and test scripts
- cases/features/decoding/ renamed to cases/features/decoder/
  - decoder/decoder.xsd renamed to decoder/simple-types.xsd
  - Use namespace xmlns:xst="http://xmlschema.test/test/" for all
    cases/features tests
  - Added XMLSchemaTestCase base class for tests/ subpackage
  - Wrote a get_testfiles() functions for tests/ subpackage in order
    to reduce redundant code in other test scripts
  - Added tests for encoding of simpleType's lists
2018-05-20 07:38:15 +02:00
Davide Brunato 22808a61dc Add test_encoding.py module and fix test_package.py
- Fix test for version that didn't match package_dir
2018-05-09 07:04:26 +02:00
Davide Brunato a3c6a66a62 Fix bug #58 and start integrating defusedxml library
Bug #58:
  - Added a file for test circular model detection

Integrating defusedxml:
  - defusedxml.ElementTree API loaded in etree.py
  - safe load with defusedxml only for network resources
2018-04-26 13:08:56 +02:00
Davide Brunato e9dcdb3f1e Implement model restriction checks
Added methods:

  - ParticleMixin.is_restriction()
  - XsdGroup.is_restriction()
  - XsdGroup.iter_group()
  - XsdElement.is_restriction()
2018-04-10 11:10:48 +02:00
Davide Brunato c0a66696be Switch to release 0.9.25
- Fixed doctest error (relative wrong XPath path)
  - Added test for issue #56
  - Version updated
2018-04-05 14:02:04 +02:00
Davide Brunato fa796d2dcf Complete xpath module substitution, improve testing
- With elementpath-1.0.4 pass all tests
  - Check version alignment with test_package.py
2018-03-27 19:47:56 +02:00
Davide Brunato e4e56124a6 Fix arguments for converters
- Added kwargs to converters initialization
  - iter_decode() arguments 'dict_class' and 'list_class' now are
    included within keyword arguments
2018-03-10 00:24:16 +01:00
Davide Brunato 0d4e2188aa fix forgot debug code mistakes (update to 0.9.22) 2018-02-16 14:19:56 +01: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 eb3dd81e65 Add pull request #36 and set version to 0.9.20 2018-01-22 17:58:46 +01:00
Davide Brunato 781ac12cbb Fix for xs:anyType validation
- A fix for validating empty groups without errors
  - TODO: raw decoding by an explicit option (or validation='skip')

A fix for substitution group building in globals_.py (that was generatingi
an error with the XSLT schema).

An update of setup.py to include grouped test cases.
2018-01-22 17:07:36 +01:00
Davide Brunato 491c83e272 Modify tests for extra schemas
- Argument --extra substituted with -s/--skip-extra that doesn't
    change the old behaviour
  - Fixed a typo for XsdSimpleType.check_facets() (min_inclusive)
  - Added a fix for lxml.etree._Comment parsing in XsdElement.iter_decode()
2018-01-17 08:31:27 +01:00
Davide Brunato c31fc194d8 Update schema class
- now parses also WSDL-SOAP original schema

  xmlschema/schema.py module:
    - more XSD compiliant imports and includes
    - added 'locations' argument to schema class init
    - improved schema location hints
    - revised documentation with more autodoc
    - schema class code cleaning
    - schema class creation is now based on a metaclass

  xmlschema/resources.py module:
    - added iter_schema_location_hints
    - fetch_schema code cleaned
    - removed old functions for retrieving XSI attributes

  xmlschema/exceptions.py module:
    - added index and expected attributes to XMLSchemaChildrenValidationError

  Updated docs using more autodocs

  Added requirements-dev.txt
2018-01-12 16:38:25 +01:00
Davide Brunato 43d0c77eee Fixed bug #34, updated copyright information. 2018-01-08 09:15:09 +01:00
Davide Brunato 090af78c7a Key/Unique/Keyref identity constraints partially rewritten
* The `set_context` method has been removed because is not always
    applicable starting from schema;
  * Now all identity constraints paths are selected from instances;
  * XPath select functions now have a name related to the selection scope;
  * Added `etree_getpath` function in etree.py;
  * Added `maxunicode` checks in codepoints.py (issue #32, Python 2.7
    compiled without --enable-unicode=ucs4) for load only UCS-2 code points.
2017-12-28 08:28:27 +01:00
Davide Brunato 27717f360f Unicode categories rewritten:
- Fixing memory usage issue #32
  - Removed the old UnicodeSubset class
  - Developing class CodePointSet renamed to UnicodeSubset
  - Added XMLSchemaChildrenValidationError to package imports
  - Fixed a typo in test_all.sh script
  - Switched to version 0.9.16
2017-12-23 10:40:07 +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 7e91aa1f1d Revising tests 2017-11-05 08:38:14 +01:00
Davide Brunato 4a8b1b7d82 Fixed some bugs:
* resources.fetch_resource function now expect a single location
  * fixed identity constraint uniqueness check
  * fixed complexContent extension
  * fixed XsdComplexType.has_simple_content method
2017-10-12 07:05:53 +02:00
Davide Brunato 17fd8eba33 Added a module for identity constraints:
* new file: xmlschema/components/constraints.py
  * parsed xs:unique, xs:key and xs:keyref and subcomponents
  * added '|' as reference delimiter in xpath.py tokenizer
  * improved XPathParser to check operator: the base class
    admits all operators, subclasses can restricts overriding
    NOT_ALLOWED_OPERATORS class attribute.
2017-07-22 07:20:16 +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 4c3add76e6 First working version for encode data to XML:
* Added ElementData namedtuple to represent Element
    decoded or encoded data.
  * Fixed a bug in qname.reference_to_qname() that mapped
    every local name to target namespace.
2017-06-15 07:59:00 +02:00
Davide Brunato e6b3383b0d Switch to version 0.9.7 with some improvements:
* Documentation extended
  * Docuemtation examples now are tested with doctest
  * Improved tests for XPath, validation and decoding
  * The collection.xsd example schema has been extended
  * Removed the exception XMLSchemaBaseValidatorError
  * Now XMLSchemaValidationError is the parent class of
    decode/encode exceptions
2017-05-21 11:27:00 +02:00
Davide Brunato b3a3a933b9 Fixed some limitations in schemas inclusions. 2016-10-25 16:43:46 +02:00
Davide Brunato 8a58c2bc01 Created a first version of manual using Sphinx. 2016-10-19 16:20:32 +02:00