This tests whether
name is a legitimate tag
to use as a direct sub-element of the
according to the definition of the
element in the specified DTD.
dtdValidElement(name, within, dtd, pos=NULL)
The name of the tag which is to be inserted inside the
The name of the parent tag the definition of which we are checking
to determine if it contains
The DTD in which the elements
An optional position at which we might add the
This applies to direct sub-elements
or children of the
within tag and not tags nested
within children of that tag, i.e. descendants.
Returns a logical value.
TRUE indicates that a
can be used inside a
FALSE indicates that it cannot.
Duncan Temple Lang
dtdFile <- system.file("exampleData", "foo.dtd", package="XML") foo.dtd <- parseDTD(dtdFile) # The following are true. dtdValidElement("variable","variables", dtd = foo.dtd) dtdValidElement("record","dataset", dtd = foo.dtd) # This is false. dtdValidElement("variable","dataset", dtd = foo.dtd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.