| Server IP : 104.21.21.239 / Your IP : 216.73.216.55 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7 System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.9/site-packages/elementpath/xpath2/__pycache__/ |
Upload File : |
a
���c�� � @ sr d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZmZmZ d d
lmZ d dlmZmZmZmZmZ d dlmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% d d
l&m'Z'm(Z(m)Z)m*Z*m+Z+ d dl,m-Z-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3m4Z4m5Z5 d dl6m7Z7 d dl8m9Z9 d dl:m;Z; G dd� de7�Z<e<j=Z=e<j>Z>e<j?Z?e<j@Z@e<jAZAe>d� e>d� e>d� e>d� e>d� e>d� e>d� e>d� e>d� e=d� e=d� e=d � e=d!� e=d"� e=d#� e=d$� e=d%� e@d&�e@d'�d(d)� ��ZBe@dd*d+�d,d-� �ZCe@d�d�d.d/��ZDe<�Ed0d1� e@e?d2d3d+��e@e?d4d3d+��d�d5d6���ZFe@d7d8d+�d9d:� �ZGe@d7�d�d;d<��ZHe@d7�d�d=d>��ZIe@d?d8d+�e@d@d8d+�dAdB� ��ZJe@d?�e@d@�d�dCdD���ZKe@dEd8d+�dFdG� �ZLe@dE�d�dHdI��ZMe@dJdKd+�e@dLdMd+�dNdO� ��ZNe@dJ�d�dPdQ��ZOe@dL�d�dRdS��ZPe@dTdUd+�e@dVdWd+�dXdY� ��ZQe@dT�e@dV�d�dZd[���ZRe@e?dd\d+��d�d]d^��ZSe@d�d�d_d`��ZTe@ddad+�dbdc� �ZUe@d�d�ddde��ZVe@d�d�dfdg��ZWe@dhdid+�e@djdid+�e@dkdid+�e@dldid+�e@dmdid+�e@dndid+�dodp� ������ZXe@dh�e@dj�e@dk�e@dl�e@dm�e@dn�d�dqdr�������ZYe@dsdid+�dtdu� �ZZe@ds�e@e?dvdid+��e@e?dwdid+��d�dxdy����Z[e@dzd{d+�d|d}� �Z\e@dz�d�d~d��Z]e@dz�d�d�d���Z^e@e?d�d�d+��d�d�d���Z_e@d1�e@d2�e@d4�e@dh�e@dj�e@dk�e@dl�e@dm�e@dn�e@ds�e@dz�e@d��e@dJ�e@dL�e@dT�e@dV�d�d�� ����������������Z`e@eAd�d�d�d���d�d�d���Zae@d��d�d�� �Zbe@eAd�d�d�d���d�d�d���Zce@d��d�d�� �Zde@eAd�d�d�d���d�d�d���Zee@eAd�d�d�d���d�d�d���Zfe@d��e@d��d�d�� ��Zge>d�� e=d�d*d*d�d�d�� e@d��d�d�� �Zhe@d��d�d�d���ZidS )�zF
XPath 2.0 implementation - part 1 (XPath2Parser class and operators)
� )�ABCMetaN)�MutableSequence)�copy)�Decimal�DivisionByZero)�urlparse)�cast�Dict�Optional� ��normalize_sequence_type)�ElementPathError�ElementPathTypeError�ElementPathValueError�MissingContextError�xpath_error)�NamespacesType�
XSD_NAMESPACE�
XML_NAMESPACE�XLINK_NAMESPACE�XPATH_FUNCTIONS_NAMESPACE�XQT_ERRORS_NAMESPACE�XSD_NOTATION�XSD_ANY_ATOMIC_TYPE�
get_namespace�get_prefixed_name�get_expanded_name)�
UntypedAtomic�QName�AnyURI�Duration�Integer)�TypedElement�
is_xpath_node�match_attribute_node�is_element_node�is_document_node)�
XPathToken�UNICODE_CODEPOINT_COLLATION�
XPathFunction)�XPath1Parser)�XPathSchemaContext)�AbstractSchemaProxyc sn e Zd ZdZdZejh d�B Zeee e
ed�ZdZ
h d�Zej�� Zd-eeeeef eeee ee ee ee ee ee eeeef eeeef edd�� fdd
�
Zdd� Zeed�dd��Zejedd�dd��Zeed�dd��Zeee d�dd��Zeed�dd��Z� fdd�Ze d.d!d"��Z!d/d$d%�Z"ed�d&d'�Z#ee$d(�� fd)d*�Z%d+d,� Z&� Z'S )0�XPath2ParseraR
XPath 2.0 expression parser class. This is the default parser used by XPath selectors.
A parser instance represents also the XPath static context. With *variable_types* you
can pass a dictionary with the types of the in-scope variables.
Provide a *namespaces* dictionary argument for mapping namespace prefixes to URI inside
expressions. If *strict* is set to `False` the parser enables also the parsing of QNames,
like the ElementPath library. There are some additional XPath 2.0 related arguments.
:param namespaces: a dictionary with mapping from namespace prefixes into URIs.
:param variable_types: a dictionary with the static context's in-scope variable types. It defines the associations between variables and static types.
:param strict: if strict mode is `False` the parser enables parsing of QNames, like the ElementPath library. Default is `True`.
:param compatibility_mode: if set to `True` the parser instance works with XPath 1.0 compatibility rules.
:param default_namespace: the default namespace to apply to unprefixed names. For default no namespace is applied (empty namespace '').
:param function_namespace: the default namespace to apply to unprefixed function names. For default the namespace "http://www.w3.org/2005/xpath-functions" is used.
:param schema: the schema proxy class or instance to use for types, attributes and elements lookups. If an `AbstractSchemaProxy` subclass is provided then a schema proxy instance is built without the optional argument, that involves a mapping of only XSD builtin types. If it's not provided the XPath 2.0 schema's related expressions cannot be used.
:param base_uri: an absolute URI maybe provided, used when necessary in the resolution of relative URIs.
:param default_collation: the default string collation to use. If not set the environment's default locale setting is used.
:param document_types: statically known documents, that is a dictionary from absolute URIs onto types. Used for type check when calling the *fn:doc* function with a sequence of URIs. The default type of a document is 'document-node()'.
:param collection_types: statically known collections, that is a dictionary from absolute URIs onto types. Used for type check when calling the *fn:collection* function with a sequence of URIs. The default type of a collection is 'node()*'.
:param default_collection_type: this is the type of the sequence of nodes that would result from calling the *fn:collection* function with no arguments. Default is 'node()*'.
z2.0>� zadjust-time-to-timezoneZcomparezone-or-moreZdouble�castable�forzyear-from-dateTimeZdateTimeZgDayZmatches�then�returnztimezone-from-time�as�abs�min�replace�schema-elementZsubsequenceZNMTOKENZgYearzelement-with-idzdocument-urizseconds-from-durationzminutes-from-dateTime�ner �intzminutes-from-timez ends-with�floatZshortZunsignedLongZ gMonthDayZIDREF�docZbase64Binaryzhours-from-time� satisfies�leZidref�toZavgZgMonth�everyzseconds-from-dateTime�eqzindex-ofz
resolve-QNamezzero-or-onezexactly-oneznamespace-uri-from-QName�else�elementztimezone-from-dateZtracezbase-uri�treatZIDZNCNamezimplicit-timezone�Name�decimalzyear-from-datezencode-for-uri�timez
insert-beforeZ hexBinary�geZunsignedByte�except�idivzcodepoint-equalzin-scope-prefixes�gtzround-half-to-evenztimezone-from-dateTime�maxZlong�root�instanceZ
gYearMonthZ unorderedz
day-from-datez
upper-casez
iri-to-urizmonth-from-dateTimezcurrent-dateTimeZnormalizedString�>>znormalize-unicode�?r �existszdefault-collationZdayTimeDuration�tokenizeZanyURI�somezstring-to-codepoints� attribute�schema-attributezlocal-name-from-QNameZlanguageZ
dateTimeStamp�inZinteger�ifzresolve-urizprefix-from-QNamezcodepoints-to-stringZpositiveIntegerZ
collectionZ
untypedAtomic�date�removezseconds-from-time�empty-sequencezday-from-dateTime�:)z
lower-casezcurrent-timeZyearMonthDurationZnilled�of�<<ZNOTATIONzyears-from-durationzmonth-from-datez
doc-available� intersect�unionzhours-from-durationzdays-from-durationz node-nameznamespace-uri-for-prefix�dataZdurationzhours-from-dateTime�reverseZ
unsignedShortzadjust-date-to-timezonezescape-html-urizadjust-dateTime-to-timezone�(:z
deep-equalzstatic-base-uriZnonNegativeIntegerZnonPositiveIntegerZunsignedInt�empty�
document-node�tokenzmonths-from-durationzcurrent-date�error�is�itemZbytezstring-joinZnegativeIntegerZENTITYzminutes-from-durationzdistinct-values�lt)ZxmlZxsZxlink�fn�err)�axis�function� kind test> z(float)z (integer)�{z (decimal)�.�(name)�(�*�@z(string)z..NTF�node()*)�
namespaces�variable_types�strict�compatibility_mode�default_collation�default_namespace�function_namespace�xsd_version�schema�base_uri�document_types�collection_types�default_collection_typer2 c sX t t� ��||� |� _|� _|d ur*|nd� _|d urB|� jd<