parameters: (filename, docname)
docstring: Get an active document and parse using the svgHandler().
  
      If no document exist, it is created.
  
      Parameters
      ----------
      filename : str
          The path to the filename to be opened.
      docname : str
          The name of the active App::Document if one exists, or
          of the new one created.
  
      Returns
      -------
      App::Document
          The active FreeCAD document, or the document created if none exists,
          with the parsed information.
docstring_summary: Get an active document and parse using the svgHandler().
docstring_tokens: Get an active document and parse using the svgHandler () .
function: def insert(filename, docname):
      """Get an active document and parse using the svgHandler().
  
      If no document exist, it is created.
  
      Parameters
      ----------
      filename : str
          The path to the filename to be opened.
      docname : str
          The name of the active App::Document if one exists, or
          of the new one created.
  
      Returns
      -------
      App::Document
          The active FreeCAD document, or the document created if none exists,
          with the parsed information.
      """
      try:
          doc = FreeCAD.getDocument(docname)
      except NameError:
          doc = FreeCAD.newDocument(docname)
      FreeCAD.ActiveDocument = doc
  
      # Set up the parser
      parser = xml.sax.make_parser()
      parser.setFeature(xml.sax.handler.feature_external_ges, False)
      parser.setContentHandler(svgHandler())
      parser._cont_handler.doc = doc
  
      # Use the native Python open which was saved as `pythonopen`
      parser.parse(pythonopen(filename))
      doc.recompute()
function_tokens: def insert ( filename , docname ) : try : doc = FreeCAD . getDocument ( docname ) except NameError : doc = FreeCAD . newDocument ( docname ) FreeCAD . ActiveDocument = doc # Set up the parser parser = xml . sax . make_parser ( ) parser . setFeature ( xml . sax . handler . feature_external_ges , False ) parser . setContentHandler ( svgHandler ( ) ) parser . _cont_handler . doc = doc # Use the native Python open which was saved as `pythonopen` parser . parse ( pythonopen ( filename ) ) doc . recompute ( )