dtdElement                package:XML                R Documentation

_G_e_t_s _t_h_e _d_e_f_i_n_i_t_i_o_n _o_f _a_n _e_l_e_m_e_n_t _o_r _e_n_t_i_t_y _f_r_o_m _a _D_T_D.

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

      dtdElement(name,dtd),
             dtdEntity(name,dtd),
      

_A_r_g_u_m_e_n_t_s:

    name: The name of the element being retrieved/acessed.

     dtd: The DTD from which the element is to be retrieved.

_D_e_t_a_i_l_s:

     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.   '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. 'dtdEntity'
     retrieves the entity definition from the DTD. \ One can read a DTD
     directly (using 'parseDTD') or implicitly when reading a document
     (using 'xmlTreeParse')  The names of all available elements can be
     obtained from the expression 'names(dtd$elements)'. This function
     is simply a convenience for indexing this 'elements' list.

_V_a_l_u_e:

     An object of class 'XMLElementDef'.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.w3.org/XML>, <URL: http://www.jclark.com/xml>,
     <URL: http://www.omegahat.org>

_S_e_e _A_l_s_o:

     'parseDTD', 'dtdValidElement'

_E_x_a_m_p_l_e_s:

      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)

