XPath Tutorial



XPath Nodes


An XPath expression can select the following types of nodes.



NodeDescriptionExample
RootRoot element node of an XML document./*
ElementElement node/item
AttributeAttribute node /item/@price
TextText or CDATA node inside an element./item/text()
CommentComment node inside an element/item/comment()
Processing InstructionProcessing Instruction/processing-instruction('xml-stylesheet')
NodeAny type of node/item/node()