Last data update: 2014.03.03

R: Retrieve the xpath to a node
xml_pathR Documentation

Retrieve the xpath to a node

Description

This is useful when you want to figure out where nodes matching an xpath expression live in a document.

Usage

xml_path(x)

Arguments

x

A document, node, or node set.

Value

A character vector.

Examples

x <- read_xml("<foo><bar><baz /></bar><baz /></foo>")
xml_path(xml_find_all(x, ".//baz"))

Results