File: xml_parse.md

package info (click to toggle)
r-cran-xml2 1.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 976 kB
  • sloc: cpp: 1,828; xml: 333; javascript: 238; ansic: 213; sh: 74; makefile: 6
file content (31 lines) | stat: -rw-r--r-- 1,079 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# read_xml errors with an empty document

    Code
      read_xml(character())
    Condition
      Error in `read_xml()`:
      ! `x` must be a single string, not an empty character vector.

# parse_options errors when given an invalid option

    Code
      read_html(test_path("lego.html.bz2"), options = "INVALID")
    Condition
      Error in `read_html()`:
      x `options` "INVALID" is not a valid option.
      i Valid options are one of "RECOVER", "NOENT", "DTDLOAD", "DTDATTR", "DTDVALID", "NOERROR", "NOWARNING", "PEDANTIC", "NOBLANKS", "SAX1", "XINCLUDE", "NONET", "NODICT", "NSCLEAN", "NOCDATA", "NOXINCNODE", "COMPACT", "OLD10", ..., "IGNORE_ENC", or "BIG_LINES".
      i See read_html (`?xml2::read_html()`) for all options.

# read_xml and read_html fail with > 1 input

    Code
      read_xml(c("foo", "bar"))
    Condition
      Error in `read_xml()`:
      ! `x` must be a single string, not a character vector.
    Code
      read_html(c("foo", "bar"))
    Condition
      Error in `read_xml()`:
      ! `x` must be a single string, not a character vector.