\Header{dtdElement}{Gets the definition of an element or entity from a DTD.}
\alias{dtdEntity}{dtdElement}
\keyword{file}{dtdElement}
\begin{Description}\relax
A DTD in R consists of both element and entity definitions.
These two functions provide simple access to 
individual elements of these two lists, using the name
of the element or entity.
The DTD is provided to determine where to look for the
entry.
\end{Description}
\begin{Usage}
\begin{verbatim} dtdElement(name,dtd),
        dtdEntity(name,dtd),
 \end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{name}] The name of the element being retrieved/acessed.
\item[\code{dtd}] The DTD from which the element is to be retrieved.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
An element within a DTD  contains
both the list of sub-elements it can contain and a list of attributes
that can be used within this tag type.  
\code{dtdElement} retrieves the
element by name from the specified DTD definition.
Entities within a DTD are like macros or text substitutes used
within a DTD and/or XML documents that use it.
Each consists of a name/label and a definition, the text
that is substituted when the entity is referenced.
\code{dtdEntity} retrieves the entity definition
from the DTD.
\bsl{}
One can read a DTD
directly (using \code{\Link{parseDTD}}) or implicitly when reading a
document (using \code{\Link{xmlTreeParse}}) 
The names of all available elements can be obtained from the expression
\code{names(dtd\$elements)}.
This function is simply a convenience for
indexing this \code{elements} list.
\end{Details}
\begin{Value}
An object of class \code{XMLElementDef}.
\end{Value}
\begin{Author}\relax
Duncan Temple Lang
\end{Author}
\begin{References}\relax
\url{http://www.w3.org/XML}, \url{http://www.jclark.com/xml},
\url{http://www.omegahat.org}
\end{References}
\begin{SeeAlso}\relax
\code{\Link{parseDTD}},
\code{\Link{dtdValidElement}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 dtdFile <- system.file("exampleData","foo.dtd", package="XML")
 foo.dtd <- parseDTD(dtdFile)
 
   # Get the definition of the `entry1' element
 tmp <- dtdElement("variable", foo.dtd)
 xmlAttrs(tmp)

 tmp <- dtdElement("entry1", foo.dtd)

  # Get the definition of the `img' entity
 dtdEntity("img", foo.dtd)
\end{ExampleCode}
\end{Examples}

