xml_url: The URL of an XML document

View source: R/xml_url.R

xml_urlR Documentation

The URL of an XML document

Description

This is useful for interpreting relative urls with url_relative().

Usage

xml_url(x)

Arguments

x

A node or document.

Value

A character vector of length 1. Returns NA if the name is not set.

Examples

catalog <- read_xml(xml2_example("cd_catalog.xml"))
xml_url(catalog)

x <- read_xml("<foo/>")
xml_url(x)

hadley/xml2 documentation built on Jan. 10, 2024, 3:52 p.m.