dtdFile <- system.file("exampleData", "foo.dtd", package="XML")
foo.dtd <- parseDTD(dtdFile)
# Look for entities.
xmlContainsEntity("foo", foo.dtd)
xmlContainsEntity("bar", foo.dtd)
# Now look for an element
xmlContainsElement("record", foo.dtd)
Run the code above in your browser using DataLab