File: isXMLString.Rd

package info (click to toggle)
r-cran-xml 3.99-0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,688 kB
  • sloc: ansic: 6,659; xml: 2,890; asm: 486; sh: 12; makefile: 2
file content (66 lines) | stat: -rw-r--r-- 2,160 bytes parent folder | download | duplicates (7)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
\name{isXMLString}
\Rdversion{1.1}
\alias{isXMLString}
\alias{xml}
\alias{xmlParseString}
\alias{XMLString-class}
\title{Facilities for working with XML strings}
\description{
 These functions and classes are used to represent and parse a
 string whose content is known to be XML.
 \code{xml} allows us to mark a character vector as containing XML,
 i.e. of class \code{XMLString}.

 \code{xmlParseString} is a convenience routine for converting an
 XML string into an XML node/tree.

 \code{isXMLString} is examines a strings content and heuristically 
 determines whether it is XML.
}
\usage{
isXMLString(str)
xmlParseString(content, doc = NULL, namespaces = RXMLNamespaces,
                clean = TRUE, addFinalizer = NA) 
xml(x) 
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{str,x,content}{the string containing the XML material.}
  \item{doc}{if specified, an \code{XMLInternalDocument} object which is
   used to "house" the new nodes. Specifically, when the nodes are
   created, they are made as part of this document. This may not be as
   relevant now with the garbage collection being done at a node and
   document level. But it still potentially of some value.}
  \item{namespaces}{a character vector giving the URIs for the XML namespaces which are to be removed if \code{clean} is \code{TRUE}.}
  \item{clean}{a logical value that controls whether namespaces are removed after the document is parsed..}
  \item{addFinalizer}{a logical value or identifier for a C routine
        that controls whether we register finalizers on the intenal node.}   
}
%\details{}
\value{
  \code{isXMLString} returns a logical value.

  \code{xmlParseString} returns an object of class
  \code{XMLInternalElementNode}.

  \code{xml} returns an object of class \code{XMLString}
  identifying the  text as \code{XML}.
}
%\references{}
\author{Dncan Temple Lang}

\seealso{
\code{\link{xmlParse}}
\code{\link{xmlTreeParse}}
}
\examples{
 isXMLString("a regular string < 20 characters long")
 isXMLString("<a><b>c</b></a>")

 xmlParseString("<a><b>c</b></a>")

  # We can lie!
 isXMLString(xml("foo"))
}
\keyword{IO}
\concept{XML}