Skip to content
Snippets Groups Projects
guess_structure.Rd 1.08 KiB
Newer Older
  • Learn to ignore specific revisions
  • % Generated by roxygen2: do not edit by hand
    % Please edit documentation in R/read_in_utils.R
    \name{guess_structure}
    \alias{guess_structure}
    \title{guess_structure}
    \usage{
    
    guess_structure(xml_node, xpath_expr, subclasses_names = character())
    
    \item{xml_node}{xml2::xml_node: XML node}
    
    \item{xpath_expr}{string: XPath expression (for subclass differentiation)}
    
    \item{subclasses_names}{Optional: character: Names of r2ogs6 subclasses
    (r2ogs6 classes without a OGS6$add method)}
    
    Guesses the R representation of an XML node and adds it to
    
    parameter list. This is a recursive function.
    
    ASSUMPTIONS:
    
    1) Leaf nodes will have EITHER a value OR attributes (and will not be missing
    both, e.g. '<a/>').
    
    2) Leaf nodes will never be r2ogs6_* objects
    
    3) If there are multiple occurrences of r2ogs6_* class (and subclass)
    elements on the same level, they have a wrapper node as their parent
    (e.g. <processes>, <properties>) which  will contain ONLY elements of this
    type
    
    4) Wrapper nodes are represented as lists
    5) Parent nodes whose children have no children are represented as lists
    }