elementpath 5.1.0__tar.gz → 5.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. {elementpath-5.1.0 → elementpath-5.1.1}/CHANGELOG.rst +6 -0
  2. {elementpath-5.1.0 → elementpath-5.1.1}/LICENSE +1 -1
  3. {elementpath-5.1.0/elementpath.egg-info → elementpath-5.1.1}/PKG-INFO +1 -1
  4. {elementpath-5.1.0 → elementpath-5.1.1}/doc/conf.py +2 -2
  5. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/__init__.py +3 -3
  6. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/aliases.py +1 -1
  7. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/collations.py +1 -1
  8. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/compare.py +1 -1
  9. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/__init__.py +1 -1
  10. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/any_types.py +1 -1
  11. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/binary.py +1 -1
  12. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/datetime.py +1 -1
  13. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/lists.py +1 -1
  14. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/numeric.py +1 -1
  15. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/proxies.py +1 -1
  16. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/qname.py +1 -1
  17. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/string.py +1 -1
  18. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/untyped.py +1 -1
  19. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/datatypes/uri.py +1 -1
  20. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/decoder.py +1 -1
  21. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/etree.py +1 -1
  22. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/exceptions.py +1 -1
  23. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/extras/pathnodes.py +1 -1
  24. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/helpers.py +1 -1
  25. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/namespaces.py +1 -1
  26. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/protocols.py +1 -1
  27. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/__init__.py +1 -1
  28. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/categories_fallback.py +1 -1
  29. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/character_classes.py +1 -1
  30. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/codepoints.py +1 -1
  31. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/patterns.py +1 -1
  32. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/unicode_blocks.py +1 -1
  33. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/unicode_categories.py +1 -1
  34. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/regex/unicode_subsets.py +1 -1
  35. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/schema_proxy.py +1 -1
  36. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/sequence_types.py +49 -2
  37. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/sequences.py +1 -1
  38. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/serialization.py +1 -1
  39. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/tdop.py +11 -6
  40. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/tree_builders.py +1 -1
  41. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/validators/__init__.py +1 -1
  42. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath1/__init__.py +1 -1
  43. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath1/_xpath1_axes.py +1 -1
  44. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath1/_xpath1_functions.py +1 -1
  45. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath1/_xpath1_operators.py +1 -1
  46. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath1/xpath1_parser.py +5 -21
  47. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath2/__init__.py +1 -1
  48. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath2/_xpath2_constructors.py +1 -1
  49. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath2/_xpath2_functions.py +1 -1
  50. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath2/_xpath2_operators.py +1 -1
  51. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath2/xpath2_parser.py +92 -152
  52. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath3.py +1 -1
  53. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/__init__.py +1 -1
  54. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/_translation_maps.py +1 -1
  55. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/_xpath30_functions.py +1 -1
  56. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/_xpath30_operators.py +1 -1
  57. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/xpath30_helpers.py +1 -1
  58. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath30/xpath30_parser.py +1 -1
  59. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath31/__init__.py +1 -1
  60. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath31/_xpath31_functions.py +1 -1
  61. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath31/_xpath31_operators.py +1 -1
  62. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath31/xpath31_parser.py +1 -1
  63. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_context.py +1 -1
  64. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_nodes.py +1 -1
  65. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_selectors.py +1 -1
  66. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/__init__.py +9 -5
  67. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/arrays.py +1 -1
  68. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/axes.py +1 -1
  69. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/base.py +2 -2
  70. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/contructors.py +37 -2
  71. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/functions.py +33 -3
  72. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/maps.py +1 -1
  73. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/xpath_tokens/tokens.py +1 -1
  74. {elementpath-5.1.0 → elementpath-5.1.1/elementpath.egg-info}/PKG-INFO +1 -1
  75. {elementpath-5.1.0 → elementpath-5.1.1}/pyproject.toml +1 -1
  76. {elementpath-5.1.0 → elementpath-5.1.1}/scripts/generate_codepoints.py +1 -1
  77. {elementpath-5.1.0 → elementpath-5.1.1}/tests/memory_profiling.py +1 -1
  78. {elementpath-5.1.0 → elementpath-5.1.1}/tests/run_all_tests.py +1 -1
  79. {elementpath-5.1.0 → elementpath-5.1.1}/tests/run_typing_tests.py +1 -1
  80. {elementpath-5.1.0 → elementpath-5.1.1}/tests/run_w3c_tests.py +1 -1
  81. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_collations.py +1 -1
  82. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_compare.py +1 -1
  83. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_datatypes.py +1 -1
  84. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_decoder.py +1 -1
  85. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_etree.py +1 -1
  86. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_exceptions.py +1 -1
  87. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_helpers.py +1 -1
  88. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_namespaces.py +1 -1
  89. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_package.py +2 -2
  90. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_pathnodes.py +1 -1
  91. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_regex.py +1 -1
  92. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_schema_context.py +1 -1
  93. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_schema_proxy.py +1 -1
  94. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_selectors.py +1 -1
  95. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_sequence_types.py +1 -1
  96. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_sequences.py +1 -1
  97. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_serialization.py +1 -1
  98. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_tdop_parser.py +19 -16
  99. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_tree_builders.py +1 -1
  100. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_validators.py +1 -1
  101. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath1_parser.py +1 -1
  102. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath2_constructors.py +1 -1
  103. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath2_functions.py +1 -1
  104. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath2_parser.py +70 -19
  105. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath30.py +1 -1
  106. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath31.py +1 -1
  107. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath_context.py +1 -1
  108. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath_nodes.py +1 -1
  109. {elementpath-5.1.0 → elementpath-5.1.1}/tests/test_xpath_tokens.py +1 -1
  110. {elementpath-5.1.0 → elementpath-5.1.1}/tests/xpath_test_class.py +1 -1
  111. {elementpath-5.1.0 → elementpath-5.1.1}/MANIFEST.in +0 -0
  112. {elementpath-5.1.0 → elementpath-5.1.1}/README.rst +0 -0
  113. {elementpath-5.1.0 → elementpath-5.1.1}/doc/Makefile +0 -0
  114. {elementpath-5.1.0 → elementpath-5.1.1}/doc/advanced.rst +0 -0
  115. {elementpath-5.1.0 → elementpath-5.1.1}/doc/index.rst +0 -0
  116. {elementpath-5.1.0 → elementpath-5.1.1}/doc/introduction.rst +0 -0
  117. {elementpath-5.1.0 → elementpath-5.1.1}/doc/make.bat +0 -0
  118. {elementpath-5.1.0 → elementpath-5.1.1}/doc/pratt_api.rst +0 -0
  119. {elementpath-5.1.0 → elementpath-5.1.1}/doc/requirements.txt +0 -0
  120. {elementpath-5.1.0 → elementpath-5.1.1}/doc/xpath_api.rst +0 -0
  121. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/extras/__init__.py +0 -0
  122. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/py.typed +0 -0
  123. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/validators/analyze-string.xsd +0 -0
  124. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath/validators/schema-for-json.xsd +0 -0
  125. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath.egg-info/SOURCES.txt +0 -0
  126. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath.egg-info/dependency_links.txt +0 -0
  127. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath.egg-info/requires.txt +0 -0
  128. {elementpath-5.1.0 → elementpath-5.1.1}/elementpath.egg-info/top_level.txt +0 -0
  129. {elementpath-5.1.0 → elementpath-5.1.1}/requirements-dev.txt +0 -0
  130. {elementpath-5.1.0 → elementpath-5.1.1}/setup.cfg +0 -0
  131. {elementpath-5.1.0 → elementpath-5.1.1}/tests/__init__.py +0 -0
  132. {elementpath-5.1.0 → elementpath-5.1.1}/tests/mypy_tests/advanced.py +0 -0
  133. {elementpath-5.1.0 → elementpath-5.1.1}/tests/mypy_tests/protocols.py +0 -0
  134. {elementpath-5.1.0 → elementpath-5.1.1}/tests/mypy_tests/selectors.py +0 -0
  135. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/analyze-string.xsd +0 -0
  136. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/external_entity.xml +0 -0
  137. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/sample.xml +0 -0
  138. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/schema-for-json.xsd +0 -0
  139. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/unparsed_entity.xml +0 -0
  140. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/unused_external_entity.xml +0 -0
  141. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/unused_unparsed_entity.xml +0 -0
  142. {elementpath-5.1.0 → elementpath-5.1.1}/tests/resources/with_entity.xml +0 -0
  143. {elementpath-5.1.0 → elementpath-5.1.1}/tox.ini +0 -0
@@ -2,6 +2,11 @@
2
2
  CHANGELOG
3
3
  *********
4
4
 
5
+ `v5.1.1`_ (2026-01-20)
6
+ ======================
7
+ * Fix external function registrations (issue #099)
8
+ * Add ExternalFunction and SchemaConstructor token classes
9
+
5
10
  `v5.1.0`_ (2025-12-28)
6
11
  ======================
7
12
  * Drop Python 3.9 compatibility and add Pyton 3.15 support
@@ -531,3 +536,4 @@ CHANGELOG
531
536
  .. _v5.0.3: https://github.com/sissaschool/elementpath/compare/v5.0.2...v5.0.3
532
537
  .. _v5.0.4: https://github.com/sissaschool/elementpath/compare/v5.0.3...v5.0.4
533
538
  .. _v5.1.0: https://github.com/sissaschool/elementpath/compare/v5.0.4...v5.1.0
539
+ .. _v5.1.1: https://github.com/sissaschool/elementpath/compare/v5.1.0...v5.1.1
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c), 2018-2025, SISSA (Scuola Internazionale Superiore di Studi Avanzati)
3
+ Copyright (c), 2018-2026, SISSA (Scuola Internazionale Superiore di Studi Avanzati)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elementpath
3
- Version: 5.1.0
3
+ Version: 5.1.1
4
4
  Summary: XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml
5
5
  Author-email: Davide Brunato <brunato@sissa.it>
6
6
  License-Expression: MIT
@@ -25,13 +25,13 @@ sys.path.insert(0, os.path.abspath('..'))
25
25
  # -- Project information -----------------------------------------------------
26
26
 
27
27
  project = 'elementpath'
28
- copyright = '2018-2025, SISSA (International School for Advanced Studies)'
28
+ copyright = '2018-2026, SISSA (International School for Advanced Studies)'
29
29
  author = 'Davide Brunato'
30
30
 
31
31
  # The short X.Y version
32
32
  version = '5.1'
33
33
  # The full version, including alpha/beta/rc tags
34
- release = '5.1.0'
34
+ release = '5.1.1'
35
35
 
36
36
  # -- General configuration ---------------------------------------------------
37
37
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -7,10 +7,10 @@
7
7
  #
8
8
  # @author Davide Brunato <brunato@sissa.it>
9
9
  #
10
- __version__ = '5.1.0'
10
+ __version__ = '5.1.1'
11
11
  __author__ = "Davide Brunato"
12
12
  __contact__ = "brunato@sissa.it"
13
- __copyright__ = "Copyright 2018-2025, SISSA"
13
+ __copyright__ = "Copyright 2018-2026, SISSA"
14
14
  __license__ = "MIT"
15
15
  __status__ = "Production/Stable"
16
16
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2025-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2025-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2022-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2022-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2022-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2022-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2024-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2024-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2016-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2016-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2025-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2021-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2021-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2025-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2016-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2016-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2016-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2016-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2016-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2016-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2016-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2016-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -15,7 +15,7 @@ import elementpath.aliases as ta
15
15
 
16
16
  from elementpath.datatypes import builtin_atomic_types, builtin_list_types, QName, \
17
17
  NumericProxy, AnyAtomicType
18
- from elementpath.exceptions import ElementPathKeyError, xpath_error
18
+ from elementpath.exceptions import ElementPathKeyError, ElementPathValueError, xpath_error
19
19
  from elementpath.namespaces import XSD_NAMESPACE, XSD_ERROR, XSD_DATETIME_STAMP, \
20
20
  XSD_NUMERIC, XSD_UNTYPED, XSD_UNTYPED_ATOMIC, get_expanded_name
21
21
  from elementpath.helpers import collapse_white_spaces, Patterns
@@ -36,6 +36,53 @@ XSD11_ONLY_TYPES = frozenset(
36
36
  )
37
37
 
38
38
 
39
+ def get_function_signatures(qname: QName,
40
+ nargs: ta.NargsType,
41
+ sequence_types: tuple[str, ...] = ()) -> dict[tuple[QName, int], str]:
42
+ """
43
+ Returns the signatures for a function.
44
+
45
+ :param qname: A QName instance that represents the FQDN of the function.
46
+ :param nargs: The number of arguments that the function takes, could the `None`, \
47
+ a non-negative integer or a couple non-negative integers or a non-negative integer \
48
+ followed by `None`.
49
+ :param sequence_types: A sequence of sequence type specifications, must match \
50
+ the number of arguments that the function takes plus the return type.
51
+ """
52
+ function_signatures: dict[tuple[QName, int], str] = {}
53
+ if not sequence_types:
54
+ return function_signatures
55
+
56
+ if any(not is_sequence_type(st) for st in sequence_types):
57
+ msg = "Error in provided sequence types: {!r}"
58
+ raise ElementPathValueError(msg.format(sequence_types))
59
+ elif nargs is None:
60
+ if len(sequence_types) != 1:
61
+ raise ElementPathValueError("Mismatched number of sequence types provided")
62
+ function_signatures[(qname, 0)] = f'function() as {sequence_types[0]}'
63
+ elif isinstance(nargs, int):
64
+ if len(sequence_types) != nargs + 1:
65
+ raise ElementPathValueError("Mismatched number of sequence types provided")
66
+ function_signatures[(qname, nargs)] = 'function({}) as {}'.format(
67
+ ', '.join(sequence_types[:-1]), sequence_types[-1]
68
+ )
69
+ elif nargs[1] is None:
70
+ if len(sequence_types) != nargs[0] + 1:
71
+ raise ElementPathValueError("Mismatched number of sequence types provided")
72
+ function_signatures[(qname, nargs[0])] = 'function({}, ...) as {}'.format(
73
+ ', '.join(sequence_types[:-1]), sequence_types[-1]
74
+ )
75
+ else:
76
+ if len(sequence_types) != nargs[1] + 1:
77
+ raise ElementPathValueError("Mismatched number of sequence types provided")
78
+ for arity in range(nargs[0], nargs[1] + 1):
79
+ function_signatures[(qname, arity)] = 'function({}) as {}'.format(
80
+ ', '.join(sequence_types[:arity]), sequence_types[-1]
81
+ )
82
+
83
+ return function_signatures
84
+
85
+
39
86
  ###
40
87
  # Sequence type checking
41
88
  @cache
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2022-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2022-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -14,9 +14,9 @@ import sys
14
14
  import re
15
15
  from abc import ABCMeta
16
16
  from collections.abc import Callable, Iterator, MutableMapping, MutableSequence
17
- from unicodedata import name as unicode_name
18
17
  from decimal import Decimal, DecimalException
19
18
  from typing import Any, cast, overload, Generic, TypeVar
19
+ from unicodedata import name as unicode_name
20
20
 
21
21
  #
22
22
  # Simple top-down parser based on Vaughan Pratt's algorithm (Top Down Operator Precedence).
@@ -49,7 +49,7 @@ class ParseError(SyntaxError):
49
49
  """An error when parsing source with TDOP parser."""
50
50
 
51
51
 
52
- def _symbol_to_classname(symbol: str) -> str:
52
+ def symbol_to_classname(symbol: str) -> str:
53
53
  """
54
54
  Converts a symbol string to an identifier (only alphanumeric and '_').
55
55
  """
@@ -693,7 +693,7 @@ class Parser(Generic[TK_co], metaclass=ParserMeta):
693
693
  token_class_name = kwargs.pop('class_name')
694
694
  else:
695
695
  token_class_name = "_%s%s" % (
696
- _symbol_to_classname(symbol),
696
+ symbol_to_classname(symbol),
697
697
  str(label).title().replace(' ', '')
698
698
  )
699
699
 
@@ -713,8 +713,13 @@ class Parser(Generic[TK_co], metaclass=ParserMeta):
713
713
  raise TypeError("A string or a %r subclass requested, not %r." % (Token, symbol))
714
714
  else:
715
715
  token_class = symbol
716
- if cls.symbol_table.get(symbol.lookup_name) is not token_class:
717
- raise ValueError("Token class %r is not registered." % token_class)
716
+ lookup_name = token_class.lookup_name
717
+
718
+ if lookup_name not in cls.symbol_table:
719
+ cls.symbol_table[lookup_name] = token_class
720
+ elif cls.symbol_table[lookup_name] is not token_class:
721
+ msg = "Token class {!r} collide on key {!r} with a different token class."
722
+ raise ValueError(msg.format(token_class, lookup_name))
718
723
 
719
724
  for key, value in kwargs.items():
720
725
  if key == 'lbp' and value > token_class.lbp:
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -24,7 +24,7 @@ from elementpath.helpers import upper_camel_case
24
24
  from elementpath.collations import UNICODE_CODEPOINT_COLLATION
25
25
  from elementpath.datatypes import QName
26
26
  from elementpath.tdop import Parser
27
- from elementpath.sequence_types import match_sequence_type
27
+ from elementpath.sequence_types import get_function_signatures, match_sequence_type
28
28
  from elementpath.schema_proxy import AbstractSchemaProxy
29
29
  from elementpath.xpath_tokens import XPathToken, XPathAxis, XPathFunction, ProxyToken, \
30
30
  NameToken, PrefixedNameToken, BracedNameToken
@@ -218,27 +218,11 @@ class XPath1Parser(Parser[ta.XPathTokenType]):
218
218
 
219
219
  if sequence_types:
220
220
  # Register function signature(s)
221
+ cls.function_signatures.update(
222
+ get_function_signatures(qname, nargs, sequence_types)
223
+ )
221
224
  kwargs['sequence_types'] = sequence_types
222
225
 
223
- if nargs is None:
224
- pass # pragma: no cover
225
- elif isinstance(nargs, int):
226
- assert len(sequence_types) == nargs + 1
227
- cls.function_signatures[(qname, nargs)] = 'function({}) as {}'.format(
228
- ', '.join(sequence_types[:-1]), sequence_types[-1]
229
- )
230
- elif nargs[1] is None:
231
- assert len(sequence_types) == nargs[0] + 1
232
- cls.function_signatures[(qname, nargs[0])] = 'function({}, ...) as {}'.format(
233
- ', '.join(sequence_types[:-1]), sequence_types[-1]
234
- )
235
- else:
236
- assert len(sequence_types) == nargs[1] + 1
237
- for arity in range(nargs[0], nargs[1] + 1):
238
- cls.function_signatures[(qname, arity)] = 'function({}) as {}'.format(
239
- ', '.join(sequence_types[:arity]), sequence_types[-1]
240
- )
241
-
242
226
  return cast(type[XPathFunction], cls.register(symbol, **kwargs))
243
227
 
244
228
  def parse(self, source: str) -> XPathToken:
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c), 2018-2025, SISSA (International School for Advanced Studies).
2
+ # Copyright (c), 2018-2026, SISSA (International School for Advanced Studies).
3
3
  # All rights reserved.
4
4
  # This file is distributed under the terms of the MIT License.
5
5
  # See the file 'LICENSE' in the root directory of the present