Commit Graph

233 Commits

Author SHA1 Message Date
Davide Brunato bc78682fe8 Extend fn:string() to schema nodes
- Removed node_string_value(), replaced entirely by the method
    string_value() of the class XPathToken.
2019-08-13 18:06:49 +02:00
Davide Brunato 116e43fc4a Add tests for helpers and schema proxy 2019-08-09 08:56:39 +02:00
Davide Brunato 852d50c087 Add get_operands() instance method to XPathToken class 2019-08-08 09:34:55 +02:00
Davide Brunato 5ae6d0f0ff Fix function conversion rules in XPathToken.get_argument()
- Added type proxy classes for XSD numeric and datetime data
  - Added tests for 'mod' operator token
2019-08-08 06:55:22 +02:00
Davide Brunato 9994139e17 Fix xs:decimal based datatypes validation and function converion rules 2019-08-05 17:51:33 +02:00
Davide Brunato f00732ede5 Fix XPath2Parser.parse() method
- In case of schema binding the static context evaluation uses
    the XPathToken.select() method because a context with a tree
    of nodes is provided.
2019-08-05 11:37:59 +02:00
Davide Brunato b5a0a87a3e Refactor xmlschema related tests
- XMLSchemaProxy will be moved to xmlschema package because
    it requires a specialized context class. Schema tests will
    be kept in elementpath to help integration and to test
    elementpath schema-related features.
2019-08-05 10:10:11 +02:00
Davide Brunato 3f50cfd962 Add __mod__ operator to UntypedAtomic class 2019-08-04 07:33:41 +02:00
Davide Brunato aeba3aab05 Split xpath_helpers module in two parts
- Datatype conversion helpers moved fo token class
  - Node helpers moved to a new module
  - Kept boolean_value() for backward compatibility
2019-08-03 22:53:37 +02:00
Davide Brunato ad96ad7e7e Add XSD special types (anyType, anySimpleType, anyAtomicType) 2019-08-03 12:35:52 +02:00
Davide Brunato bb7f000fec Update development requirements (xmlschema~=1.0.13) 2019-08-03 12:30:59 +02:00
Davide Brunato 74db431c25 Add build section to tox.ini and add tests for schema proxy 2019-05-29 15:39:42 +02:00
Davide Brunato fea7c0d7b5 Add tests for XPathContext to increase coverage
- Removed circularity checks that not works with ElementTree and
    is not necessary for lxml.etree
2019-05-22 19:11:47 +02:00
Davide Brunato 2935eacfa7 Update LICENSE 2019-05-22 06:53:09 +02:00
Davide Brunato c97acb9eb8 Added a script for testing XPathContext class 2019-05-21 07:17:58 +02:00
Davide Brunato 1d23f5b13f Update to release v1.1.8
- Added coverage and flake8 to testing
  - Removed py34 from tox.ini
  - Added py38 with a limited testing
  - ElementPathMissingContextError renamed to MissingContextError
  - Added exceptions to API docs
2019-05-20 23:22:14 +02:00
Davide Brunato 46ac3a6a1c Raise err:XPST0081 for a prefix associated to no namespace 2019-05-20 13:56:02 +02:00
Davide Brunato 9bfdedc831 Raise a more specific error for wrong number of arguments
- Applied to functions and constructors
  - Raises a TypeError instead of a generic SyntaxError
  - Added tests for execptions in test_helpers.py
2019-05-20 11:08:49 +02:00
Davide Brunato cface8447b Fix issue #4
- Added a context manager method use_locale() to XPathToken class
  - Added an exception class ElementPathLocaleError
2019-05-19 16:24:19 +02:00
Davide Brunato 5d715f98fc Add coverage to testing
- Added .coveragerc
  - Added tests/test_helpers.py
  - Added coverage to develop requirements
  - Code cleaning for xpath_helpers.py
2019-05-17 07:35:41 +02:00
Davide Brunato 12f94db836 Update to release v1.1.7 and fix for max()/min() functions
- Fix fn:max() and fn:min() error in case of an empty sequence: now
    the error is intercepted and the functions return an empty list.
2019-04-25 16:18:34 +02:00
Davide Brunato 12b71ba5ee Fix spacing errors
- Added is_spaced() to TODP Parser base class
  - Remove '/' from next_is_path_step_token() methods
  - Increase release and update API documentation
2019-03-30 10:59:23 +01:00
Davide Brunato 66dcdf2f25 Update to release v1.1.6 2019-03-28 14:14:27 +01:00
Davide Brunato a0ca1eb135 Fixes for XSD datatypes
- Add '.' equivalent Unicode characters to QName pattern
  - Fix integers validators
2019-03-27 08:29:57 +01:00
Davide Brunato a8a431627e Add a test for child axis with an element reference 2019-03-13 11:22:23 +01:00
Davide Brunato 75101d530a Change default year from 1900 to 2000
- 2000 is a leap year, that is needed by gMonthDay value '--02-29'
  - Start new release v1.1.6
2019-03-05 18:19:42 +01:00
Davide Brunato a1506e8334 Hotfix release v1.1.5
- Fix issue #3 splitting xs:gYear type, creating an unordered base
    type XPathGregorianYear and then deriving GregorianYear10 also from
    OrderedDateTime to implement comparison operators.
  - Rewritten in the same way the remaining gregorian types, inverting
    the bases (put XSD 1.0 only types as the base).
2019-02-23 22:25:14 +01:00
Davide Brunato 36fcdba9e6 Update release and add get_primitive_type() to docs 2019-02-22 09:35:59 +01:00
Davide Brunato 808d0ef75d Closing the release v1.1.4
- Add get_primitive_type() to XMLSchemaProxy
  - Restore boolean_value() usage with an additional token=None argument
    to preserve compatibility with xmlschema v1.0.9
  - Remove XPathToken.boolean()
  - XSD_BUILTIN_TYPES sample values completed
2019-02-21 19:46:17 +01:00
Davide Brunato 7539b5b0e1 Add tests for value comparison operators
- Remove the usage of boolean_value() helper from package, replaced
    by XPathToken.boolean() helper
  - Update the changelog
2019-02-21 16:06:54 +01:00
Davide Brunato 8139f86807 Fix XPath 2.0 value comparison operators 2019-02-21 12:40:17 +01:00
Davide Brunato 7d19a84c7f Fix XSD type matching
- XPathToken.match_xsd_type() now returns only the type or None
  - '(name)' token behaves like as a dynamic context case, returning
    values only if the context item is an XSD attribute
  - Code cleaning of datatypes and schema_proxy modules
2019-02-21 09:44:42 +01:00
Davide Brunato 5947ab6181 Rewrite schema interfaces
- Removed AbstractSchemaContext and XMLSchemaContext classes
  - Added helper method match_xsd_type() to XPathToken
  - Added abstract interfaces for XSD elements, attributes and types,
    for supporting alternative schema proxy implementations
2019-02-20 15:32:13 +01:00
Davide Brunato b4ad5c6e5f Update documentation and changelog 2019-02-20 15:29:19 +01:00
Davide Brunato d7af1ff171 Add AbstractSchemaContext and XMLSchemaContext classes
- Schema context classes are used for static typing phase
  - XMLSchemaContext implement match_schema_type(self, name) method
2019-02-19 06:48:37 +01:00
Davide Brunato 1b2aaed6c0 Add schema typing to tokens
- Added class attribute xsd_type=None to XPathToken
  - Added to '(name)' token select method (xpath1_parser.py)
2019-02-17 09:16:29 +01:00
Davide Brunato 4230146f97 Add base_element to AbstractSchemaProxy
- base_element as initial context item in static analysis phase
2019-02-16 09:55:14 +01:00
Davide Brunato dcfa6209f4 Add schema to static analysis phase
- Added XPathSchemaContext class to schema_proxy.py
2019-02-15 18:44:18 +01:00
Davide Brunato b392d7534e Realize a full static analysis 2019-02-15 14:00:49 +01:00
Davide Brunato b184cb0e0b Close release v1.1.3 2019-02-06 23:46:20 +01:00
Davide Brunato 79d6e1e81e Fix fn:translate() for Python 2 compatibility 2019-02-06 23:43:00 +01:00
Davide Brunato dbea2f3208 Check and fix fn:floor(), fn:ceiling() and fn:round() 2019-02-06 23:31:38 +01:00
Davide Brunato 1954376c82 Check and fix fn:number() and fn:sum() 2019-02-06 21:26:25 +01:00
Davide Brunato 1d72fe052d Check and fix XPath 1.0/2.0 functions 2019-02-06 18:21:23 +01:00
Davide Brunato 162c18084b Merge branch 'master' of github.com:brunato/elementpath 2019-02-06 08:54:37 +01:00
Davide Brunato 9d18e4e135 Other fixes for function processing
- XPathToken.get_arguments() updated
  - compatibility_mode transformed to property
  - Other tests on functions
2019-02-05 23:34:29 +01:00
Davide Brunato 25c5b0de56
Merge pull request #2 from imoore76/master
https://github.com/brunato/elementpath/issues/1
2019-02-05 23:33:23 +01:00
Ian Moore 153a51392c https://github.com/brunato/elementpath/issues/1 2019-02-05 15:54:27 -05:00
Davide Brunato 806c9096de Add tests/test_selectors.py 2019-02-05 13:26:42 +01:00
Davide Brunato 353b421e80 Fixes for some strings/numerical functions and div operator
- Rewrite div operator for XPath1 with IEEE 754 division by zero
  - fn:substring() rewritten
2019-02-05 11:53:27 +01:00