| Server IP : 104.21.21.239 / Your IP : 216.73.217.74 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.9/site-packages/elementpath/__pycache__/ |
Upload File : |
a
���cx � @ s� d dl mZmZmZmZmZ ddlmZ ddlm Z m
Z
ddlmZ ddl
mZ eee Zde eeeeed�d d
�Zde eeeeee d�dd�ZG d
d� de�ZdS )� )�Any�Dict�Optional�Iterator�Type� )�NamespacesType)�ContextRootType�XPathContext)�XPath1Parser)�XPath2ParserN)�root�path�
namespaces�parser�kwargs�returnc
K s� |� dd�|� dd�|� dd�|� dd�|� dd�|� dd�|� d d�d
�}|pRt|fi |��}|�|�}t| fi |��}|�|�S )a!
XPath selector function that apply a *path* expression on *root* Element.
:param root: an Element or ElementTree instance.
:param path: the XPath expression.
:param namespaces: a dictionary with mapping from namespace prefixes into URIs.
:param parser: the parser class to use, that is :class:`XPath2Parser` for default.
:param kwargs: other optional parameters for the parser instance or the dynamic context.
:return: a list with XPath nodes or a basic type for expressions based on a function or literal.
�itemN�positionr �size�axis� variables�
current_dt�timezone�r r r r r r r )�popr �parser
�get_results� r
r r r r Zcontext_kwargsZ_parser�
root_token�context� r! �?/usr/lib/python3.9/site-packages/elementpath/xpath_selectors.py�select s
�
r# c
K s� |� dd�|� dd�|� dd�|� dd�|� dd�|� dd�|� d d�d
�}|pRt|fi |��}|�|�}t| fi |��}|�|�S )a
A function that creates an XPath selector generator for apply a *path* expression
on *root* Element.
:param root: an Element or ElementTree instance.
:param path: the XPath expression.
:param namespaces: a dictionary with mapping from namespace prefixes into URIs.
:param parser: the parser class to use, that is :class:`XPath2Parser` for default.
:param kwargs: other optional parameters for the parser instance or the dynamic context.
:return: a generator of the XPath expression results.
r Nr r r r r r r r )r r r r
�select_resultsr r! r! r"