Check if the provided string is in valid XML format.
Arguments
- input_string
A character string to be checked for XML format.
Value
A logical value. If the input string is in valid XML format, returns
TRUE, otherwise returns FALSE.
Author
Ulrich Matter umatter@protonmail.com
Examples
is_xml('<?xml version="1.0"?><root><element>value</element></root>')
#> [1] TRUE
# TRUE
is_xml('<root><element>value</element></root>')
#> [1] TRUE
# FALSE
is_xml('')
#> Empty string provided.
#> [1] FALSE
# FALSE