Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getXMLErrors

Get XML/HTML document parse errors


Description

This function is intended to be a convenience for finding all the errors in an XML or HTML document due to being malformed, i.e. missing quotes on attributes, non-terminated elements/nodes, incorrectly terminated nodes, missing entities, etc. The document is parsed and a list of the errors is returned along with information about the file, line and column number.

Usage

getXMLErrors(filename, parse = xmlParse, ...)

Arguments

filename

the identifier for the document to be parsed, one of a local file name, a URL or the XML/HTML content itself

parse

the function to use to parse the document, usually either xmlTreeParse or htmlTreeParse.

...

additional arguments passed to the function given by parse

Value

A list of S3-style XMLError objects.

Author(s)

Duncan Temple Lang

References

See Also

error argument for xmlTreeParse and related functions.

Examples

# Get the "errors" in the HTML that was generated from this Rd file
  getXMLErrors(system.file("html", "getXMLErrors.html", package = "XML"))

## Not run: 
  getXMLErrors("http://www.omegahat.net/index.html")

## End(Not run)

XML

Tools for Parsing and Generating XML Within R and S-Plus

v3.99-0.10
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>), Tomas Kalibera [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.