https://github.com/cran/XML
Raw File
Tip revision: e5f799606ed2954eebe22a350be3254b5bcac5b2 authored by Duncan Temple Lang on 14 March 2007, 00:00:00 UTC
version 1.5-1
Tip revision: e5f7996
DTDRef.R
# These are classes and facilities for referring to a DTD for the
# DOCTYPE field of an XML document

setClass("Doctype", representation(name = "character",
                                   system = "character",
                                   public = "character"))

Doctype =
function(system = "", public = "", name = "")
{
  new("Doctype", name = name, system = system, public = public)
}

setAs("Doctype", "character",
       function(from) {

         if(sum(nchar(from@public), nchar(from@system)))
            extra = c("SYSTEM", ifelse(from@public != "", dQuote(from@public), ""), 
                                ifelse(from@system != "", dQuote(from@system), ""))
         paste("<!DOCTYPE", from@name, paste(extra, collapse = " "), ">")
       })



back to top