Understanding XPath | lxml | markup | markdown
2020-12-07 16:01:58 【Quant_ Learner】
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
The design goals of XML emphasize simplictiy, generality, and usability across the Internet.
A markup language is a system for annotating a document in a way that is syntactically distinguishable from the text, meaning when the document is processed for display, the markup language is not shown, and is only used to format the text.
Markdown is a lightweight markup language with plain-text-formatting syntax, created in 2004 by John Gruber and Aaron Swartz.
XPath(XML Path Language) is a query language for selecting nodes from an XML document. XPath was defined by the World Wide Web Consortium (W3C).
XPathlanguage is based on a tree representation of the
XMLdocument, an XPath expression is often referred to simply as “an XPath”.
XPath Nodes has several kinds:
XML documents are treated as trees of nodes. The topmost element of the tree is called the root element.
Atomic values are nodes with no
XPath axes represents a relationship to the
context (current) node, and is used to locate nodes relative to that node on the tree.
Each element and attribute has one parent.
Element nodes may have zero, one or more children.
Nodes that have the same parent.
A node’s parent, parent’s parent, etc.
A node’s children, children’s children.
XPath uses path expressions to select nodes or node-sets in an XML document.
Expression Description nodename Selects all nodes with the name “nodename” / Selects from the root node // Selects nodes in the document from the current node that match the selection no matter where they are . Selects the current node … Selects the parent of the current node @ Selects attributes /bookstore/book Predicates, used to find a specific node * Matches any element node @* Matches any attribute node node() Matches any node of any kind
AxisName Result ancestor Selects all ancestors (parent, grandparent, etc.) of the current node ancestor-or-self Selects all ancestors (parent, grandparent, etc.) of the current node and the current node itself attribute Selects all attributes of the current node child Selects all children of the current node descendant Selects all descendants (children, grandchildren, etc.) of the current node descendant-or-self Selects all descendants (children, grandchildren, etc.) of the current node and the current node itself following Selects everything in the document after the closing tag of the current node following-sibling Selects all siblings after the current node namespace Selects all namespace nodes of the current node parent Selects the parent of the current node preceding Selects all nodes that appear before the current node in the document, except ancestors, attribute nodes and namespace nodes preceding-sibling Selects all siblings before the current node self Selects the current node
An XPath expression returns either a node-set, a string, a Boolean, or a number.
Operator Description Example | Computes two node-sets //book | //cd + Addition 6 + 4 - Subtraction 6 - 4 * Multiplication 6 * 4 div Division 8 div 4 = Equal price=9.80 != Not equal price!=9.80 < Less than price<9.80 <= Less than or equal to price<=9.80 > Greater than price>9.80 >= Greater than or equal to price>=9.80 or or price=9.80 or price=9.70 and and price>9.00 and price<9.90 mod Modulus (division remainder) 5 mod 2
XPathis a major element in the
XSLT(Extensible Stylesheet Language Transformation) is a language for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subsequently be converted to other formats, such as PDF, PostScript and PNG.
- Introduction to common tuning tools for JVM
- Summary and analysis of the list of top 50 bloggers of 1024 activities in 2020, please call for your favorite bloggers! (integration of selected articles)
- prometheus-net.DotNetRuntime 获取 CLR 指标原理解析
Data collection mechanism and strategy in business scenarios
. net cloud native architect training camp (module 2 Foundation Consolidation log) - learning notes
Principle of code generator
. net cloud native architect training camp (module 2 Foundation Consolidation rest & restful)
- Once centos7. X is installed, Zeppelin v0.9.0 is deployed, and PostgreSQL database is configured
- MongoDB 基础手册（一）
- Simple use of struct module
- 2021 年国产数据库名录和产品信息一览
- Bpmn.js 中文文档（一）
- Open source of table component based on efcore
- Hack Technology
- Ytu-cst winter training base camp
- WPF foundation - x namespace
- Concept of tcapsusdb knowledge base (table, key, record, index)
- Maxkey single sign on authentication system v2.6.0ga released
- SQL排名问题，100% leetcode答案大公开！
- Daily work knowledge
- 2020 top 50 blogger list summary analysis, please call for your favorite bloggers! (integration of selected articles)
- Metadata management - the complete implementation of dynamic form designer in crudapi system
- Collation of common commands of JVM
- Why do you call this a sentinel?
- Alibaba cloud Internet of things.net core client| CZGL.AliIoTClient : 2. IOT client
- Introduction of common tuning tools for JVM
- BB network layer test
- Common table effects
- Team work 8 -- the second project Sprint (beta stage) Day1 -- 5.18
- Window Pains
- ==Compare with equals
- In order to better design the database, reorganize the SQL server data type
- DOM node
- Zheng Zheng | 2021 software code development technology assignment 5 | code development, testing and release
- Ytu-cst winter training base camp
- Artdialog configuration parameters
- General use case of security test
- Wechat applet map component
- C format string
- Open source and SaaS at home and abroad, team collaboration platform and project management tools
- I want my project 6666, but chrome doesn't agree!
- Overview of applet components