getXMLErrors: Get XML/HTML document parse errors

Description Usage Arguments Value Author(s) References See Also Examples

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

1

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

libxml2 (http://xmlsoft.org)

See Also

error argument for xmlTreeParse and related functions.

Examples

1
2
3
4
5
6
7
     # 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)


Search within the XML package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.