Skip to content

Commit 36248a5

Browse files
authored
Merge pull request #26 from mluis7/pxx-9
pxx-9 upload version 0.3.3 to PyPI
2 parents f28359d + fc67dba commit 36248a5

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
# pyxml2xpath
33
Parse an XML document with [lxml](https://lxml.de/) and build XPath expressions corresponding to its structure.
44

5-
<h3> &#x24D8; Project status: BETA (RC2) </h3>
6-
75
Table of contents
86
=================
97

108
* [Basic usage](#description)
11-
* [Build and install](#build-and-install)
9+
* [Installation](#installation)
1210
* [Command line usage](#command-line-usage)
1311
* [Module usage](#module-usage)
1412
* [Method parse(...)](#method-parse)
@@ -43,9 +41,15 @@ text node types can be used in predicates but not on path
4341

4442
It can be used as a [command line utility](#command-line-usage) or as a [module](#module-usage).
4543

46-
A spin off of [xml2xpath Bash script](https://github.com/mluis7/xml2xpath). Both projects rely on [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) implementation.
44+
> A spin off of [xml2xpath Bash script](https://github.com/mluis7/xml2xpath). Both projects rely on [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) implementation.
45+
46+
## Installation
47+
Installing from PyPi
48+
49+
`pip3.9 install pyxml2xpath`
50+
51+
Or building from source repo
4752

48-
## Build and install
4953
```bash
5054
git clone https://github.com/mluis7/pyxml2xpath.git
5155
cd pyxml2xpath
@@ -59,8 +63,6 @@ Alternative without cloning the repo yourself
5963
pip3.9 install git+https://github.com/mluis7/pyxml2xpath.git
6064
```
6165

62-
Soon on PyPi!
63-
6466
## Command line usage
6567
`pyxml2xpath <file path> [mode] [initial xpath expression] [with count] [max elements] [without banners]`
6668

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.2rc2
1+
0.3.3

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ readme = "README.md"
1919
license = {file = "LICENSE"}
2020
keywords = ["xpath", "xml"]
2121
classifiers = [
22-
"Development Status :: 4 - Beta",
22+
"Development Status :: 5 - Production/Stable",
2323
"Programming Language :: Python"
2424
]
2525

src/xml2xpath/xml2xpath.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def parse_mixed_ns(tree: etree._ElementTree,
125125
xpath_base: str
126126
Xpath expression to start from
127127
with_count: bool
128-
add count of found elements (performance cost on large documents.
128+
add count of found elements (performance cost on large documents).
129129
max_items: int
130130
max number of elements to parse. Default: 100000'''
131131

@@ -162,12 +162,12 @@ def parse_mixed_ns(tree: etree._ElementTree,
162162
# parent may exist even if xpath_base is a relative path: //soapenv:Body
163163
prnt = ele.getparent()
164164
if prnt is not None:
165-
pqname = etree.QName(prnt.tag)
166-
# parent's (unqualified) xpath
167-
xpp = tree.getpath(prnt)
168165
# type(ele): etree._Element
169166
if type(ele.tag) is str:
170167
qname = etree.QName(ele.tag)
168+
pqname = etree.QName(prnt.tag)
169+
# parent's (unqualified) xpath
170+
xpp = tree.getpath(prnt)
171171
# parent of current element was already parsed so
172172
# just append current qualified name
173173
if xpp in xmap:

0 commit comments

Comments
 (0)