parseDTD(extId, asText=FALSE, name="", isURL=FALSE, error = xmlErrorCumulator())
link{xmlTreeParse}
.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.
namename of the attribute, i.e. the left hand side
typethe type of the value, e.g. an CDATA, Id, Idref(s), Entity(s), NMToken(s), Enumeration, Notation
defaultTypethe defined type, one of None, Implied, Fixed or Required.
defaultValuethe default value if it is specified, or the enumerated values as a character vector, if the type is Enumeration.xmlTreeParse
,
WritingXML.html in the distribution. dtdFile <- system.file("exampleData", "foo.dtd",package="XML")
parseDTD(dtdFile)
txt <- readLines(dtdFile)
txt <- paste(txt, collapse="\n")
d <- parseDTD(txt, asText=TRUE)
## Not run:
# url <- "http://www.omegahat.net/XML/DTDs/DatasetByRecord.dtd"
# d <- parseDTD(url, asText=FALSE)
# ## End(Not run)
Run the code above in your browser using DataLab