Davide Brunato
ad41660f9e
Fix typed selection
...
- Fix XPathToken.select_results() for element selection
- Fix XPathContext.get_parent() for typed elements
2019-10-07 17:08:47 +02:00
Davide Brunato
9c4b942700
Split and rename test_helpers module
...
- Unify XPathToken unit tests into class XPathTokenTest
2019-10-07 08:34:21 +02:00
Davide Brunato
526e9baa9f
Add schema matching by path
2019-10-05 20:47:32 +02:00
Davide Brunato
04f63f6b4d
Add LRU cached resolvers to context class
...
- Add get_parent() and get_path() to XPathContext
2019-10-04 20:44:39 +02:00
Davide Brunato
de6955b36c
Update test requirements
...
- Now uses xmlschema~=1.0.14
- Update fn:in-scope-prefixes()
- Remove module xpath_helpers.py
2019-10-04 10:00:39 +02:00
Davide Brunato
22d9f4258d
Add select_results() to XPathToken
2019-09-30 17:17:05 +02:00
Davide Brunato
72a99dc39f
Adapt XPathContext to typed iterations
...
renamed: tests/test_context.py -> tests/test_xpath_context.py
2019-09-30 11:17:04 +02:00
Davide Brunato
3cd4c95272
Add typed nodes for XSD decoded values processing
...
- Added TypedAttribute and TypedElement nametuples
2019-09-28 09:15:17 +02:00
Davide Brunato
c367bdfd95
Improve node sequence operators
...
- Add is_root class attribute to XPathToken
- '(name)' token yield AttributeNode objects for non-root tokens
2019-09-27 18:31:02 +02:00
Davide Brunato
77afa93a15
Add validate() to XSD type interface
2019-09-26 16:24:29 +02:00
Davide Brunato
8cc023d077
Add iter_preceding() to XPathContext
2019-09-24 16:17:51 +02:00
Davide Brunato
307d638f96
Fix count() function and '//', '/' binding power
2019-09-24 11:16:23 +02:00
Davide Brunato
18871936cb
Fix datatypes, context and token classes
...
- Fix leap year calculation into AbstractDateTime
- Fix _iter_context for yielding AttributeNode tuples
- Fix '|' select method for attribute matching
- Fix get_atomized_operand() for XSD decode of untyped data
2019-09-21 15:21:25 +02:00
Davide Brunato
23fc3542ca
Fix 24-hour time for DateTime
2019-09-11 22:18:49 +02:00
Davide Brunato
04258f5c43
Fix '//' operator and text() function
...
- '//' without a left token has to start from the document root,
like an absolute path.
2019-09-09 07:16:00 +02:00
Davide Brunato
910b63603a
Add tests for XPathToken helpers and datatypes
2019-08-30 08:16:38 +02:00
Davide Brunato
cf59d52ca9
Fix xs:language pattern and XPathToken.get_results()
2019-08-14 18:15:56 +02:00
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
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
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
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
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
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
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
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