Commit Graph

90 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 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 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 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 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 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 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 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 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 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
Ian Moore 153a51392c https://github.com/brunato/elementpath/issues/1 2019-02-05 15:54:27 -05: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
Davide Brunato 2041b5fc95 Fix wrong overwrite of "(" XPath 1.0 token 2019-02-04 08:48:54 +01:00
Davide Brunato f561cbcd5b Fix starts-with, concat and contains functions 2019-02-04 07:22:20 +01:00
Davide Brunato c03e88906f Update tests and docs
- Add 2019 to copyright information
  - Update Shphinx docs about XPath 2 status
  - Tests splitted into several modules (all tests are runned as before
    by the script test_elementpath.py or by "python -m unitest")
2019-01-12 10:28:44 +01:00
Davide Brunato 44b06dddc0 Add fn:avg, fn:max and fn:min functions 2018-12-21 19:15:12 +01:00
Davide Brunato 8733c5468b Add 'boolean' multi-label token (function and constructor) 2018-12-17 23:01:15 +01:00
Davide Brunato 584bb726d5 Revise TDOP parser module (minor fixes and docstrings) 2018-12-17 17:15:32 +01:00
Davide Brunato e1e4433ea5 Code cleaning for TDOP parser module
- Added special tokens to Parser.SYMBOLS
  - Now a symbol has to be into the Parser class SYMBOLS
2018-12-14 14:49:40 +01:00
Davide Brunato 1f9aeb466b Define operators for xs:yearMonthDuration and xs:dayTimeDuration 2018-12-04 12:40:39 +01:00
Davide Brunato bf382bf530 Add tzinfo implementation for XSD timezones 2018-12-02 10:05:03 +01:00
Davide Brunato 0bd8f454d3 Defined constructor for xs:hexBinary 2018-11-23 06:40:31 +01:00
Davide Brunato 29dbec0d81 Implement QName related functions
- XPathToken.error method now return an error instance
2018-11-15 08:53:17 +01:00
Davide Brunato e33fd554a5 Set bp defaults for XPath parser builder methods
- Set bp=90 for XPath1Parser.function class method
  - Set bp=80 for XPath1Parser.axis class method
  - Set bp=90 for XPath2Parser.constructor class method
2018-11-13 18:41:41 +01:00
Davide Brunato f6a84a7dc1 Wrote tests for float and decimal XPath XSD constructors 2018-11-13 18:09:08 +01:00
Davide Brunato b7ccdc1439 Improve error management
- ElementPathError extended with three arguments, for managing
    of simple errors and also of token generated errors.
  - Add error helper method to XPathToken class.
2018-11-13 14:06:39 +01:00
Davide Brunato 9ceec72a77 Refactor tokenizer builder and XSD constructor functions
- Now the XPath2Parser can will be progressively extended with XSD builtin
    constructors without importing dependant package xmlschema.
2018-11-12 22:04:04 +01:00
Davide Brunato c660de0ff1 Rationalize wrong_syntax error generation helper method
- Removed from the parser, improved for tokens.
2018-11-10 11:08:09 +01:00
Davide Brunato 6a41a9e3ef Implementing xsd builtin constructors for XPath2Parser 2018-11-08 06:52:00 +01:00
Davide Brunato 8c094eb348 Update to new release 1.0.12
- Added default_namespace property to XPath parser classes
  - XPath1Parser ignores the default namespace setting
  - Fixed the '(name)' token methods to use the default namespace
2018-09-01 18:04:13 +02:00
Davide Brunato f4c4894278 Update to version 1.0.9 2018-06-15 18:14:43 +02:00
Davide Brunato 777ce76e64 Added metaclass ParserMeta
- Now parsers are created checking and setting class main attributes
2018-06-15 09:14:08 +02:00
Davide Brunato cfb183124e TDOP Parser class cleaning
- Fixed pickling also for parser's tokens: token classes
    are now registered to parser's module.
  - Defined the helper function symbol_to_identifier().
  - Removed Parser.begin() method.
2018-06-14 10:04:31 +02:00