parseDTD(extId, asText=F, name="", isURL=F)
XMLEntity
or alternatively XMLExternalEntity
if the entity refers
to an external definition.
The fields of these types of objects are
XMLElementDef
which has 4 fields.
element
or mixed
.
The name of the value is a user-level type. The value is used for programming, both
internally and externally.
}
XMLElementContent
or one of its specializations - XMLSequenceContent
, XMLOrContent
.
Each of these encodes the number of such elements permitted
(one, one or more, zero or one, or zero or more);
the type indicating whether the contents consist of a single element type,
an ordered sequence of elements, or one of a set of elements.
Finally, the actual contents description is described in the
elements
field. This is a list of
one or more XMLElementContent
, XMLSequenceContent
and XMLOrContent
objects.
}
XMLAttributeDef
which has 4 fields.
xmlTreeParse
,
WritingXML.html in the distribution.dtdFile <- system.file("data/foo.dtd",pkg="XML")
parseDTD(dtdFile)
# Read from text
txt <- scan(dtdFile, what="", sep="")
txt <- paste(txt, collapse="")
d <- parseDTD(txt, asText=T)
url <- "http://www.omegahat.org/XML/DTDs/DatasetByRecord.dtd"
d <- parseDTD(url, asText=T)
Run the code above in your browser using DataLab