parameters: (self, xml_text, ros_config, core=False, verbose=True)
docstring: Load XML text into launch configuration
          @param xml_text: XML configuration
          @type  xml_text: str
          @param ros_config: launch configuration to load XML file into
          @type  ros_config: L{ROSLaunchConfig}
          @param core: if True, load file using ROS core rules
          @type  core: bool
docstring_summary: Load XML text into launch configuration
docstring_tokens: Load XML text into launch configuration
function: def load_string(self, xml_text, ros_config, core=False, verbose=True):
          """
          Load XML text into launch configuration
          @param xml_text: XML configuration
          @type  xml_text: str
          @param ros_config: launch configuration to load XML file into
          @type  ros_config: L{ROSLaunchConfig}
          @param core: if True, load file using ROS core rules
          @type  core: bool
          """
          try:
              if verbose:
                  print("... loading XML")
              try:
                  if hasattr(xml_text,'encode') and isinstance(xml_text, unicode):
                      # #3799: xml_text comes in a unicode object, which
                      # #fails since XML text is expected to be encoded.
                      # that's why force encoding to utf-8 here (make sure XML header is utf-8)
                      xml_text = xml_text.encode('utf-8')
              except NameError:
                  pass
              root = parseString(xml_text).getElementsByTagName('launch')
          except Exception as e:
              logging.getLogger('roslaunch').error("Invalid roslaunch XML syntax:\nstring[%s]\ntraceback[%s]"%(xml_text, traceback.format_exc()))
              raise XmlParseException("Invalid roslaunch XML syntax: %s"%e)
          
          if len(root) != 1:
              raise XmlParseException("Invalid roslaunch XML syntax: no root <launch> tag")
          self._load_launch(root[0], ros_config, core, filename='string', verbose=verbose)
function_tokens: def load_string ( self , xml_text , ros_config , core = False , verbose = True ) : try : if verbose : print ( "... loading XML" ) try : if hasattr ( xml_text , 'encode' ) and isinstance ( xml_text , unicode ) : # #3799: xml_text comes in a unicode object, which # #fails since XML text is expected to be encoded. # that's why force encoding to utf-8 here (make sure XML header is utf-8) xml_text = xml_text . encode ( 'utf-8' ) except NameError : pass root = parseString ( xml_text ) . getElementsByTagName ( 'launch' ) except Exception as e : logging . getLogger ( 'roslaunch' ) . error ( "Invalid roslaunch XML syntax:\nstring[%s]\ntraceback[%s]" % ( xml_text , traceback . format_exc ( ) ) ) raise XmlParseException ( "Invalid roslaunch XML syntax: %s" % e ) if len ( root ) != 1 : raise XmlParseException ( "Invalid roslaunch XML syntax: no root <launch> tag" ) self . _load_launch ( root [ 0 ] , ros_config , core , filename = 'string' , verbose = verbose )