parameters: (self, element, parent_dir)
docstring: Replace the XML element 'element' with the child nodes of the root element of the included DOM.
  
          This performs all necessary consistency checks to ensure the result is again a well-formed DOM.
  
          After this function returns, the element 'element' is no longer part of the original DOM, it is unlinked, and
          must not be accessed or used in the context of the calling function.
docstring_summary: Replace the XML element 'element' with the child nodes of the root element of the included DOM.
docstring_tokens: Replace the XML element element with the child nodes of the root element of the included DOM .
function: def resolve_include_element(self, element, parent_dir):
          """Replace the XML element 'element' with the child nodes of the root element of the included DOM.
  
          This performs all necessary consistency checks to ensure the result is again a well-formed DOM.
  
          After this function returns, the element 'element' is no longer part of the original DOM, it is unlinked, and
          must not be accessed or used in the context of the calling function.
  
          """
          if element_children(element):
              raise SystemParseError(xml_error_str(element, 'Expected no child elements in include element. \
  Correct format is <include file="FILENAME" />'))
  
          path_attribute = get_attribute(element, 'file')
          if path_attribute == NOTHING:
              raise SystemParseError(xml_error_str(element, 'Expected include element to contain "file" attribute. \
  Correct format is <include file="FILENAME" />'))
  
          if os.path.isabs(path_attribute):
              path_to_include = path_attribute
          else:
              for include_path in [parent_dir] + self._include_paths:
                  path_to_include = os.path.join(include_path, path_attribute)
                  if os.path.isfile(path_to_include):
                      break
  
          path_to_include = os.path.normpath(path_to_include)
          if not os.path.exists(path_to_include):
              raise SystemParseError(xml_error_str(element, 'The path {} specified in the include element does not \
  refer to an existing file. \
  The path is considered to be {}. \
  The known prx include paths are {})'.format(path_to_include,
                                              'absolute' if os.path.isabs(path_attribute) else 'relative',
                                              self._include_paths)))
  
          included_root_element = self.parse(path_to_include)
          if included_root_element.tagName != 'include_root':
              raise SystemParseError(xml_error_str(included_root_element, 'The XML root element in file {} is not named\
   include_root as expected. Root elements in included XML files must have this name by convention and are removed \
  implicitly by the inclusion process.'))
  
          parent_node = element.parentNode
          for child in included_root_element.childNodes[:]:
              parent_node.insertBefore(child, element)
          parent_node.removeChild(element)
          element.unlink()
function_tokens: def resolve_include_element ( self , element , parent_dir ) : if element_children ( element ) : raise SystemParseError ( xml_error_str ( element , 'Expected no child elements in include element. \
  Correct format is <include file="FILENAME" />' ) ) path_attribute = get_attribute ( element , 'file' ) if path_attribute == NOTHING : raise SystemParseError ( xml_error_str ( element , 'Expected include element to contain "file" attribute. \
  Correct format is <include file="FILENAME" />' ) ) if os . path . isabs ( path_attribute ) : path_to_include = path_attribute else : for include_path in [ parent_dir ] + self . _include_paths : path_to_include = os . path . join ( include_path , path_attribute ) if os . path . isfile ( path_to_include ) : break path_to_include = os . path . normpath ( path_to_include ) if not os . path . exists ( path_to_include ) : raise SystemParseError ( xml_error_str ( element , 'The path {} specified in the include element does not \
  refer to an existing file. \
  The path is considered to be {}. \
  The known prx include paths are {})' . format ( path_to_include , 'absolute' if os . path . isabs ( path_attribute ) else 'relative' , self . _include_paths ) ) ) included_root_element = self . parse ( path_to_include ) if included_root_element . tagName != 'include_root' : raise SystemParseError ( xml_error_str ( included_root_element , 'The XML root element in file {} is not named\
   include_root as expected. Root elements in included XML files must have this name by convention and are removed \
  implicitly by the inclusion process.' ) ) parent_node = element . parentNode for child in included_root_element . childNodes [ : ] : parent_node . insertBefore ( child , element ) parent_node . removeChild ( element ) element . unlink ( )