File: docName.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 (60 lines) | stat: -rw-r--r-- 1,617 bytes parent folder | download | duplicates (8)
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
\name{docName}
\alias{docName}
\alias{docName,XMLDocument-method}
\alias{docName,XMLDocumentContent-method}
\alias{docName,XMLHashTree-method}
\alias{docName,XMLInternalDocument-method}
\alias{docName,XMLInternalNode-method}
\alias{docName,XMLHashTreeNode-method}
\alias{docName,NULL-method}
\alias{docName,XMLNode-method}
\alias{docName<-}
\alias{docName<-,XMLInternalDocument-method}
\alias{docName<-,XMLHashTree-method}
\title{Accessors for name of XML document}
\description{
  These functions and methods allow us to query and set the 
  \dQuote{name} of an XML document. This is intended to be
  its URL or file name or a description of its origin if
  raw XML content provided as a string.
}
\usage{
docName(doc, ...)
}
\arguments{
  \item{doc}{the XML document object, of class
     \code{XMLInternalDocument} or \code{XMLDocument}.
  }
  \item{\dots}{additional methods for methods}
}
\value{
  A character string giving the name.
  If the document was created from text, this is \code{NA}
  (of class character).


  The assignment function returns the updated object,
  but the R assignment operation will return the value
  on the right of the assignment!
}
\author{Duncan Temple Lang}
\seealso{
 \code{\link{xmlTreeParse}}
 \code{\link{xmlInternalTreeParse}}
 \code{\link{newXMLDoc}}

}
\examples{
  f = system.file("exampleData", "catalog.xml",  package = "XML")
  doc = xmlInternalTreeParse(f)
  docName(doc)

  doc = xmlInternalTreeParse("<a><b/></a>", asText = TRUE)
      # an NA
  docName(doc)
  docName(doc) = "Simple XML example"
  docName(doc)
}
\keyword{IO}
\keyword{programming}
\concept{XML}