xmlNode                 package:XML                 R Documentation

_C_r_e_a_t_e _a_n _X_M_L _n_o_d_e

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

     These functions allow one to create XML nodes as are created in C
     code when reading XML documents. Trees of XML nodes can be
     constructed and  integrated with other trees generated manually or
     with via the parser.

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

     xmlNode(name, ..., attrs=NULL, namespace="", .children = list(...))
     xmlTextNode(value, namespace="", entities = XMLEntities)
     xmlPINode(sys, value, namespace="")
     xmlCDataNode(...)
     xmlCommentNode(text)

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

    name: The tag or element name of the XML node. This is what appears
          in the elements as '<name> .. </name>'

     ...: The children nodes of this XML node. These can be objects of
          class 'XMLNode' or arbitrary values that will be converted to
          a string to form an 'XMLTextNode' object.

.children: an alternative mechanism to specifying the children which is
          useful for programmatic use when one has the children in an
          existing list.  The ... mechanism is for use when the
          children are specified directly and individually. 

   attrs: A named character vector giving the  name, value pairs of
          attributes for this XML node.

   value: This is the text that is to be used when forming an
          'XMLTextNode'.

namespace: The XML namespace identifier for this node.

     sys: the name of the system for which the processing instruction
          is targeted. This is the value that appears in the '<?sys
          value?>'

    text: character string giving the contents of the comment.

entities: a character vector giving the mapping from special characters
          to their entity equivalent. This provides the 
          character-expanded entity pairings of 'character = entity' ,
          e.g. '<' = "lt" which are used to make the content valid XML
          so that it can be used within a text node.   The text
          searched sequentially for instances of each character in the
          names and each instance is replaced with the corresponding
          '&entity;' 

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

     An object of class 'XMLNode'. In the case of 'xmlTextNode', this
     also inherits from 'XMLTextNode'. The fields or slots that objects
     of these classes have include 'name', 'attributes', 'children' and
     'namespace'. However, one should  the accessor functions
     'xmlName', 'xmlAttrs', 'xmlChildren' and 'xmlNamespace'

_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:

     'addChildren'   'xmlTreeParse' 'asXMLNode' 'newXMLNode'
     'newXMLPINode' 'newXMLCDataNode' 'newXMLCommentNode'

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

      # node named arg with two children: name and defaultValue
      # Both of these have a text node as their child.
     a <- xmlNode("arg", attrs = c(default="TRUE"),
                    xmlNode("name", "foo"), xmlNode("defaultValue","1:10"))

       # internal C-level node.
      newXMLNode("arg", attrs = c(default = "TRUE"),
                  newXMLNode("name", "foo"),
                  newXMLNode("defaultValue", "1:10"))

