print.XMLAttributeDef          package:XML          R Documentation

_M_e_t_h_o_d_s _f_o_r _d_i_s_p_l_a_y_i_n_g _X_M_L _o_b_j_e_c_t_s

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

     These different methods attempt to provide a convenient way to
     display R objects representing XML elements when they are printed
     in the usual manner on the console, files, etc. via the 'print'
     function. Each typically outputs its contents in the way that they
     would appear in an XML document.

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

     print.XMLNode(x, ..., indent= "", tagSeparator = "\n")
     print.XMLComment(x, ..., indent = "", tagSeparator = "\n")
     print.XMLTextNode(x, ..., indent = "", tagSeparator = "\n")
     print.XMLCDataNode(x, ..., indent="", tagSeparator = "\n")
     print.XMLProcessingInstruction(x, ..., indent="", tagSeparator = "\n")
     print.XMLAttributeDef(x, ...)
     print.XMLElementContent(x, ...)
     print.XMLElementDef(x, ...)
     print.XMLEntity(x, ...)
     print.XMLEntityRef(x, ..., indent= "", tagSeparator = "\n")
     print.XMLOrContent(x, ...)
     print.XMLSequenceContent(x, ...)

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

       x: the XML object to be displayed

     ...: additional arguments for controlling the output from print.
          Currently unused.

  indent: a prefix that is emitted before the node to indent it
          relative to its parent and child nodes. This is appended with
          a space at each succesive level of the tree. If no
          indentation is desired (e.g. when 'xmlTreeParse' is called
          with 'trim' and 'ignoreBlanks' being 'FALSE') and 'TRUE'
          respectively, one can pass the value 'FALSE' for this
          'indent' argument. 

tagSeparator: when printing nodes, successive nodes and children are by
          default displayed on new lines for easier reading. One can
          specify a string for this argument to control how the
          elements are separated in the output.  The primary purpose of
          this argument is to allow no space between the elements, i.e.
          a value of '""'. 

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

     Currently, 'NULL'.

_N_o_t_e:

     We could make the node classes self describing with information
     about whether 'ignoreBlanks' was 'TRUE' or 'FALSE' and if trim was
     TRUE or FALSE. This could then be used to determine the
     appropriate values for 'indent' and 'tagSeparator'. Adding an S3
     class element would allow this to be done without the addition of
     an excessive number of classes.

_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>, <URL: http://www.omegahat.org/RSXML>

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

     'xmlTreeParse'

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

       fileName <- system.file("exampleData", "event.xml", package ="XML")

          # Example of how to get faithful copy of the XML.
       doc = xmlRoot(xmlTreeParse(fileName, trim = FALSE, ignoreBlanks = FALSE))
       print(doc, indent = FALSE, tagSeparator = "")

          # And now the default mechanism
       doc = xmlRoot(xmlTreeParse(fileName))
       print(doc)

