File: xmlCleanNamespaces.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 (47 lines) | stat: -rw-r--r-- 1,462 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
\name{xmlCleanNamespaces}
\alias{xmlCleanNamespaces}
\title{Remove redundant namespaces on an XML document}
\description{
  This is a convenience function that removes redundant
  repeated namespace definitions in an XML node.
  It removes namespace definitions in nodes
  where an ancestor node also has that definition.
  It does not remove unused namespace definitions.

  This uses the \code{NSCLEAN} option for \code{\link{xmlParse}}
}
\usage{
xmlCleanNamespaces(doc, options = integer(), out = docName(doc), ...)
}
\arguments{
  \item{doc}{either the name of an XML documentor the XML content
    itself, or an already parsed document}
  \item{options}{options for the XML parser. \code{NSCLEAN} is added to this.}
  \item{\dots}{additional arguments passed to \code{\link{xmlParse}}}
  \item{out}{the name of a file to which to write the resulting XML
    document, or an empty character vector or logical value \code{FALSE}
    to avoid writing the new document.
   }
}
\value{
  If the new document is written to a file, the name of the file is
  returned.
  Otherwise, the new parsed XML document is returned.
}
\references{
libxml2 documentation \url{http://xmlsoft.org/html/libxml-parser.html}
}
\author{
Duncan Temple Lang
}
\seealso{
\code{\link{xmlParse}}
}
\examples{
f = system.file("exampleData", "redundantNS.xml", package = "XML")
doc = xmlParse(f)
print(doc)
newDoc = xmlCleanNamespaces(f, out = FALSE)
}
\keyword{programming} 
\keyword{IO}