dtdValidElement             package:XML             R Documentation

_D_e_t_e_r_m_i_n_e_s _w_h_e_t_h_e_r _a_n _X_M_L _t_a_g _i_s _v_a_l_i_d _w_i_t_h_i_n _a_n_o_t_h_e_r.

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

     This tests whether 'name' is a legitimate tag  to use as a direct
     sub-element of the 'within' tag according to the definition of the
     'within' element in the specified DTD.

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

     dtdValidElement(name, within, dtd, pos=NULL)

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

    name: The name of the tag which is to be inserted inside the
          'within' tag.

  within: The name of the parent tag the definition of which we are
          checking to determine if it contains 'name'.

     dtd: The DTD in which the elements 'name' and 'within' are
          defined. 

     pos: An optional position at which we might add the 'name' element
          inside 'within'. If this is specified, we have a stricter
          test that accounds for sequences in which elements must
          appear in order. These are comma-separated entries in the
          element definition.

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

     Returns a logical value. TRUE indicates that a 'name' element can
     be used inside a 'within' element. FALSE indicates that it cannot.

_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', 'dtdElement', 'dtdElementValidEntry',

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

      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)

