Comments (2)
Keep in mind that etree paths are not XPath-compatible and probably never will be. They are much simpler. According to the documentation:
Although path strings are XPath-like, only the following limited syntax is supported:
. Selects the current element
.. Selects the parent of the current element
* Selects all child elements
// Selects all descendants of the current element
tag Selects all child elements with the given tag
[#] Selects the element of the given index (1-based,
negative starts from the end)
[@attrib] Selects all elements with the given attribute
[@attrib='val'] Selects all elements with the given attribute set to val
[tag] Selects all elements with a child element named tag
[tag='val'] Selects all elements with a child element named tag
and text matching val
[text()] Selects all elements with non-empty text
[text()='val'] Selects all elements whose text matches val
If you require full XPath support, I recommend using the xmlpath package instead.
from etree.
Ok. Thanks for your guidance
from etree.
Related Issues (20)
- function AddChild bug? HOT 1
- Can you share performance benchmarks or steps to measure it for this tool? HOT 2
- Perhaps link prominently to docs? HOT 1
- Add doctype read HOT 1
- a bug of Element.Text() HOT 1
- Error Read xml ISO-8859-1 HOT 1
- can not parse xml with "&" HOT 1
- Unexpected <></> when adding outer layer HOT 3
- Expected " but " HOT 1
- go version EOL HOT 1
- how to pretty print when writing back HOT 4
- xml writeto string? HOT 1
- UTF-8 support HOT 3
- Does this library supports XInclude standards for XML document? HOT 1
- How do I remove indent between inline labels? HOT 2
- Is there any way to get the comments of a document? HOT 5
- i don't wanna the string text to be escaped, how can i achieve that HOT 5
- if my text contains some string likes '<br>',but i dont wanna to escape them,how can i do HOT 2
- XPath string literal syntax does not accept double quotes HOT 2
- Avoid panics when element doesn't exist HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from etree.