Java XML Tutorial
Selected Reading
- Java XML - Discussion
- Java XML - Useful Resources
- Java XML - Quick Guide
- Java XML - Questions and Answers
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- Java DOM4J Parser
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- Java XPath Parser
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- Java StAX Parser
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- JDOM XML Parser
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- Java SAX Parser
- Modify XML Document
- Create XML Document
- Query XML Document
- Parse XML Document
- Java DOM Parser
- Java XML Parsers
- Java XML Overview
- Java XML Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java XPath Parser
Java XPath Parser - Overview
XPath是万维网集团的一项正式建议。 它界定了在XML档案中查找信息的语文。 它被用于掩盖XML文件的内容和属性。 XPath提供了各种表达方式,可用于查询XML文件的相关信息。
What is XPath?
结构定义——XPath界定了XML文件的某些部分,如内容、属性、文字、名称空间、处理、评论和文件节点。
XSLT的Major part of XSLT> - XPath is one of the main elements in XSLT standard and one must have sufficient knowledge of XPath in order to work with XSLT documents.
W3C建议——XPath是万维网联合会(W3C)的正式建议。
XPath Expressions
XPath使用一条途径,从XML文件中挑选节点或节点清单。 以下是从XML文件中选择任何节点/节点清单的有用途径和表述清单。
Sr.No. | Expression & Description |
---|---|
1 | 用特定名称选择所有节点 |
2 | 遴选从深层节点开始 |
3 | www.un.org/Depts/DGACM/index_spanish.htm 甄选从目前与甄选相吻合的节点开始。 |
4 | <>。 选择目前的节点 |
5 | <>。 选择目前的代号的母子 |
6 | 选择属性 |
7 | <student <>Example——用“student”名称选择所有节点 |
8 | Example- 选择所有属于班级子女的学生 |
9 | 选择所有学生,不论他们是否在文件中 |
Predicates
具体指标用于寻找含有特定价值的具体节点或节点,并以[...]加以界定。
Expression | Result |
---|---|
/class/student[1] | Selects the first student element that is the child of the class element. |
/class/student[last()] | Selects the last student element that is the child of the class element. |
/class/student[last()-1] | Selects the last but one student element that is the child of the class element. |
//student[@rollno = 493 ] | Selects all the student elements that have an attribute named rollno with a value of 493 |