docName

0th

Percentile

Accessors for name of XML document

These functions and methods allow us to query and set the “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.

Keywords
programming, IO
Usage
docName(doc, ...)
Arguments
doc

the XML document object, of class XMLInternalDocument or XMLDocument.

additional methods for methods

Value

A character string giving the name. If the document was created from text, this is 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!

See Also

xmlTreeParse xmlInternalTreeParse newXMLDoc

Aliases
  • docName
  • docName,XMLDocument-method
  • docName,XMLDocumentContent-method
  • docName,XMLHashTree-method
  • docName,XMLInternalDocument-method
  • docName,XMLInternalNode-method
  • docName,XMLHashTreeNode-method
  • docName,NULL-method
  • docName,XMLNode-method
  • docName<-
  • docName<-,XMLInternalDocument-method
  • docName<-,XMLHashTree-method
Examples
# NOT RUN {
  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)
# }
Documentation reproduced from package XML, version 3.98-1.19, License: BSD_2_clause + file LICENSE

Community examples

Looks like there are no examples yet.