xmlAttributeType             package:XML             R Documentation

_T_h_e _t_y_p_e _o_f _a_n _X_M_L _a_t_t_r_i_b_u_t_e _f_o_r _e_l_e_m_e_n_t _f_r_o_m _t_h_e _D_T_D

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

     This examines the definition of the  attribute, usually returned
     by parsing the DTD with `parseDTD' and determines  its type from
     the possible values: Fixed, string data, implied,  required,  an
     identifier,  an identifier reference, a list of identifier
     references, an entity, a list of entities,  a name, a list of
     names, an element of enumerated set,  a notation entity.

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

     xmlAttributeType(def, defaultType=F)

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

     def: the attribute definition object, usually retrieved from the
          DTD via `parseDTD'.

defaultType: whether to return the default value if this attribute is
          defined as being a value from an enumerated set.

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

     A string identifying the type for the sspecified attributed.

_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.omegahat.org/RSXML>

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

     `parseDTD'

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

     ##---- Should be DIRECTLY executable !! ----
     ##-- ==>  Define data, use random,
     ##--         or do  help(data=index)  for the standard data sets.

     ## The function is currently defined as
     function (def, defaultType = F) 
     {
         if (defaultType == F & names(def$type)[1] == "Enumeration") {
             return(paste("(", paste(def$defaultValue, collapse = " | "), 
                 ")", sep = " ", collapse = ""))
         }
         switch(ifelse(defaultType, names(def$defaultType)[1], names(def$type)[1]), 
             Fixed = "#FIXED", CDATA = "CDATA", Implied = "#IMPLIED", 
             Required = "#REQUIRED", Id = "#ID", IDRef = "#IDREF", 
             IDRefs = "#IDREFS", Entity = "#ENTITY", Entities = "ENTITIES", 
             NMToken = "#NMTOKEN", NMTokens = "#NMTOKENS", Enumeration = "", 
             Notation = "", "<BROKEN>")
       }

