XPath can quickly navigate to a node or attribute in the XML. The XPath syntax is simple, but powerful enough, and it is also the basic knowledge of using XSLT.Sample xml:
1234567891011121314151617181920212223242526272829
xmlversion="1.0" encoding="utf-8" ?>pets>cat color="black" weight="10">price>100price>desc>this is a black catdesc>cat>catcolo
[Original address: http://www.cnblogs.com/hya1109/archive/2007/12/16/996535.html]
I have also sent a message about. net, but it is not very detailed. Now I will introduce in detail how to operate XML files in C #, just like learning to operate a database and learn the SQL language, before learning to operate XML and the language, we need to familiarize ourselves with the XML "SQL" Statement XPath. Since this series of posts does not aim to introduce t
the parent node of the current node
Preceding
XPath ('./preceding::* ')
Selects all nodes in the document before the start tag of the current node
Preceding-sibling
XPath ('./preceding-sibling::* ')
Select the sibling node before the current node
Self
XPath ('./self::* ')
Sele
the parent node of the current node
Preceding
XPath ('./preceding::* ')
Selects all nodes in the document before the start tag of the current node
Preceding-sibling
XPath ('./preceding-sibling::* ')
Select the sibling node before the current node
Self
XPath ('./self::* ')
Sele
Use the following XML document to describe the XPath Syntax:
Locate a node:The XML document can be viewed as a node tree (similar to a computer tree folder ).XPath uses pattern expressions to recognize nodes in XML documents. An XPATH mode is a list of child element names separated by diagonal lines to describe a path
When using dom4j, we cannot obtain an element across layers. it must be obtained at one layer, which is very troublesome.
Why xpath?
When using dom4j, we cannot obtain an element across layers. it must be obtained at one layer, which is very troublesome.Therefore, we can use the xpath technology to access a node more conveniently, which allows us to conveniently read the specified node.
this:This XML file represents the reseller. The dealer is a node, and the dealer "inside" is a node that represents the onboard inventory. The dealer is the "parent" of the car node, and the car node is the "child". Then there are branches underneath the car node that produce the "Kids" node. Each vehicle node forms a "sibling" relationship. In this example, there is a tree-multi-attribute relationship. property enables the intrinsic characteristics of a particular node. You'll notice that each
Chapter 4: XPath syntax
ArticleAuthor: A Jie
4. XPath syntax As we have mentioned earlier, XPath is a language used to help XSLT search for location information in XML so
4. XPath syntax
As we have mentioned earlier, XPath is a language used to help XSLT search for location information in XML source documents. In actual use, XPath and XSLT are always used together. In the above chapter, we have used the XPath
4.XPath of syntaxAs we mentioned earlier, XPath is the language used to help XSLT find positioning information in an XML source document. In actual use, XPath and XSLT are always mixed together, and in the syntax examples in the previous chapter we already have the syntax to
XPath is the XML query language, which is similar to SQL. The XML below is used as an example to introduce the XPath syntax.
Locate a node XML is a tree structure, similar to the structure of the data folder in the file system. XPath is similar to the path naming method in the file sys
I've been on it before. NET operation of XML, but not very detailed, now I will explain how C # to operate XML files, just as learning to operate the database to learn the SQL language, before learning to manipulate XML and language, we need to familiarize ourselves with XML "SQL" statement XPath. Since the purpose of this series of posts is not to introduce the XPath s
The specific learning of XPath can be viewed through the viewing (link: http://www.w3school.com.cn/xpath/index.asp)Here is just the usual use of a few tables posted, later query:Here's the XPath I personally feel like selectors that havesyntax +XPath axis operation + operator + functionSeveral combinations are used.A l
XPath example
This topic reviews the syntax examples in the entire XPath reference. All examples are based on the example XML file of xpath syntax appended to this section.
Expression reference./AuthorAll AuthorAll First. NameAll /BookstoreThe document elements of this docum
XPath syntax is still very powerful, support some functions and operators, convenient operation, but because of the version of the possible functions can only be used in XPath2 (2007), and not in XPath1 (1999), such as function Ends-with ( String).
XPath syntax in the selection of DOM object search is very useful,
I have also sent a message about. net, but it is not very detailed. Now I will introduce in detail how to operate XML files in C #, just like learning to operate a database and learn the SQL language, before learning to operate XML and the language, we need to familiarize ourselves with the XML "SQL" Statement XPath. Since this series of posts does not aim to introduce the XPath
This topic reviews the syntax examples in the entire XPath reference. All examples are example XML files (inventory. xml) based on the XPath syntax ). For an example of using an XPath expression in the test file, see the "Union (|) Example" at the end of this topic ".
long as one boss + several core members. But this requires long-term cooperation in order to produce such a core of leadership.Soldiers are not more than the fine, this truth is difficult to understand before, and recently began to have a profound experience. A team of dozens of people, if it is a mob, is far from the efficiency of the lean team of 10 people.Increasing the number of people will increase the cost of internal communication. If the boss does not have a strong personal charisma and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.