XPath TutorialLesson 47Free preview
XPath Nodes
This lesson is part of XML · All levels
Summary
XPath recognizes seven types of nodes: root, element, attribute, text, namespace, processing instruction, and comment. Each type has its own writing method, e.g. @ for attribute and text() for text content. Understanding the type of node helps to formulate the exact target expression.
Key points
- XPath recognizes seven different types of nodes
- Root is a document root that is different from the root element
- Attributes are selected with @ followed by the attribute name
- Text content is selected with text()
- Processing instruction and comment are also nodes
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.