Commit Graph

31 Commits

Author SHA1 Message Date
Davide Brunato d89a597c82 Update documentation and fix PEP8 errors 2019-10-11 13:44:10 +02:00
Davide Brunato 9e58e99e01 Add XSD 1.1 support and XSD components API to documentation 2019-08-19 13:52:30 +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 674f14c3ff Update docs and CHANGELOG.rst 2019-06-19 10:35:13 +02:00
Davide Brunato 69405e662c Add info for building custom converters to docs (issue #109) 2019-06-14 09:07:05 +02:00
Davide Brunato 149a1e454f Update documentation 2019-05-05 15:08:58 +02:00
Davide Brunato 1c1dc6b60f Increase release and update documentation 2019-04-08 07:29:09 +02:00
Davide Brunato 4dc7714a18 Update documentation and requirements 2019-02-25 14:44:28 +01:00
Davide Brunato 19cde9ec39 Update documentation 2019-02-02 23:16:45 +01:00
Davide Brunato 2eabc190fe Replace defusedxml dependency
- The defusedxml seems to be unmaintained and has some problems
    with the ElementTree loading
  - Replaced by a safe XMLParser that forbids entities processing
2019-01-22 17:50:13 +01:00
Davide Brunato 96cb4b57af Refactoring of error and to etree_tostring serialization
- Added namespaces argument to etree_tostring helper method.
  - Refactored validator error string representation.
  - Moved namespaces argument at last position for methods validate
    and iter_errors of class ValidationMixin.
  - Fixed document validate API and added tests for it
2018-08-27 15:43:19 +02:00
Davide Brunato 3f8d56070d Create XsdDeclaration class as XsdComponent subclass
- Unify code for XSD declarations, that are the components that are
     referenciable (elements, attributes, groups and attribute groups)
2018-07-26 15:19:26 +02:00
Davide Brunato 80c200f651 Add is_etree_element helper function
- This is a more safer test for Element objects for this package, because it
    also checks that the argument is not an instance of ElementPathMixin class
  - Add tests for fetch_schema_locations and load_xml_resource functions
2018-07-13 22:40:35 +02:00
Davide Brunato dd43288abd Update test case parser for release
- "--defaults" option removed (cases merged within --skip)
  - "--baseurl" removed (useless, the cases are all URL-based)
2018-07-12 17:32:36 +02:00
Davide Brunato 1ee9d88c01 Fix decoder tests
- Update converters (level optional parameter also for iter_decode)
  - Update tests for decoder
  - Update namespace decoding
  - Update doctest
2018-07-03 13:32:45 +02:00
Davide Brunato 49e8b22869 Added JSON serialization functions at module level
- Updated and revised documentation
  - Code cleaning (iter_encode and iter_decode args)
  - to_json() and from_json() module functions
  - New tests for module level API
2018-06-28 13:52:21 +02:00
Davide Brunato 3d84da310c Update documentation with new features 2018-05-08 06:57:49 +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 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 ee116aea83 Update documentation
- Updated documentation tests
  - Fixed iter_decode() misfunctioning with validation='skip'
2018-01-21 14:05:57 +01:00
Davide Brunato 92cf6d87ab Revise the patch for issue #35
- Updated XsdAnyElement.iter_children_decode(): now returns couples
    (None, child) if the child element is not decodable/validatable.
  - Updated XsdGroup.iter_decode: if not all the child are validated by
    the model report an error and perform a raw decoding.
  - XsdGrup.raw_validation() renamed to XsdGroup.iter_raw_decode().

XsdComponent.__repr__() now use prefixed_name instead of name in order
to provides more readable output.

XsdAnyElement now has a custom __repr__ method.
2018-01-21 07:04:28 +01:00
Davide Brunato db1821a229 Put a patch for issue #35 in XsdGroup.iter_decode
- Related to residual emptiable content parsing of a top level
    group of a sequence
  - The patch code have to be moved to XsdGroup
  - Added a case for the issue

Some refactoring to XsdComponent: target_namespace, namespace and maps
are trasformed to @property functions.

Update documentation for pass doctests.
2018-01-20 06:11:43 +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 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 efe90cc5af Updated documentation and final checks. 2017-07-08 10:12:01 +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 cf4e46f5be Implemented some converters for XML to JSON:
* Default converter (the format used by the package before)
  * Converters for JsonML, Parker, Badgerfish and Abdera conventions
  * Update of the documentation
2017-06-12 17:43:37 +02:00
Davide Brunato f37c0d446a Improved XPath selection for unqualified elements:
* XsdElement.iterchildren() now considers if an XSD
    element form is 'unqualified'
  * Fixed documentation
  * Added maps.base_elements to local views
2017-05-27 09:21:37 +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 3d1a262898 Extended testing with other schemas and test scripts:
- Added a test to run all tests with all intalled Python versions;
  - Removed some obsolete or incomplete APIs;
  - Added XHTML 1.0 to base schemas.
2017-02-18 08:34:18 +01:00
Davide Brunato 8a58c2bc01 Created a first version of manual using Sphinx. 2016-10-19 16:20:32 +02:00