Convert XML Reserved Strings to XML Entities

DESCRIPTION:

Converts strings reserved for XML (such as double-quotes and angle brackets) to the XML entities used to include them in XML documents.

USAGE:

java.xml.string(str)

REQUIRED ARGUMENTS:

str
a character vector. Any reserved strings are converted to their equivalent entities.

VALUE:

a character vector, with XML entities in place of the original reserved characters.

SIDE EFFECTS:

None.

DETAILS:

The XML format reserves certain characters (including double-quote, less-than sign, etc) for particular uses. To use these characters within string values, they must be converted to special sequences of characters. The function java.xml.string takes a vector of strings, and converts them into strings with the XML quote sequences, as shown in the Examples section.

SEE ALSO:

EXAMPLES:

java.xml.string("bad characters: \"<hello & Goodbye>\"")
# returns the following:
#    [1] "bad characters: &quot;&lt;hello & Goodbye&gt;&quot;"