1\name{Doctype} 2\alias{Doctype} 3\alias{coerce,Doctype,character-method} 4\title{Constructor for DTD reference} 5\description{ 6 This is a constructor for the \code{Doctype} class 7 that can be provided at the top of an XML document 8 to provide information about the class of document, 9 i.e. its DTD or schema. 10 Also, there is a method for converting such a \code{Doctype} 11 object to a character string. 12} 13\usage{ 14Doctype(system = character(), public = character(), name = "") 15} 16\arguments{ 17 \item{system}{the system URI that locates the DTD. } 18 \item{public}{the identifier for locating the DTD in a catalog, for 19 example. This should be a character vector of length 2, giving 20 the public identifier and a URI. If just the public identifier 21 is given and a string is given for \code{system} argument, 22 the \code{system} value is used as the second element of 23 \code{public}. 24 The public identifer should be of the form 25 \code{+//creator//name//language} 26 where the first element is either + or -, and 27 the language is described by a code in the ISO 639 document. 28 } 29 \item{name}{the name of the root element in the document. 30 This should be the first parameter, but is left this way 31 for backward compatability. And } 32} 33\value{ 34 An object of class \code{Doctype}. 35} 36\references{\url{http://www.w3.org/XML} 37 XML Elements of Style, Simon St. Laurent. 38} 39\author{ Duncan Temple Lang } 40 41 42\seealso{ 43 \code{\link{saveXML}} 44} 45\examples{ 46 47 d = Doctype(name = "section", 48 public = c("-//OASIS//DTD DocBook XML V4.2//EN", 49 "http://oasis-open.org/docbook/xml/4.2/docbookx.dtd")) 50 as(d, "character") 51 52 # this call switches the system to the URI associated with the PUBLIC element. 53 d = Doctype(name = "section", 54 public = c("-//OASIS//DTD DocBook XML V4.2//EN"), 55 system = "http://oasis-open.org/docbook/xml/4.2/docbookx.dtd") 56} 57\keyword{IO} 58 59