def parsexml(self, xmlstring, modules, source=None):
        """Parses the docstrings out of the specified xml file.

        :arg source: the path to the file from which the XML string was extracted.
        """
        result = {}

        from fortpy.utility import XML_fromstring
        xmlroot = XML_fromstring(xmlstring, source)
        if xmlroot.tag == "fortpy" and "mode" in xmlroot.attrib and \
           xmlroot.attrib["mode"] == "docstring":
            #First, cycle through the kids to find the <global> tag (if any
            #exist). It's children will apply to any of the other tags we find
            #and we will have to update their attributes accordingly.
            xmlglobals = {}
            for child in xmlroot.iterfind("globals"):
                _update_globals(list(child), xmlglobals)
            _set_global_defaults(xmlglobals)
                
            #We fill the dictionary with decorates names as keys and lists
            #of the xml docstring elements as values.
            for child in xmlroot:
                if child.tag == "globals":
                    continue

                xmltags = []
                if child.tag == "decorates" and "name" in child.attrib:
                    decorates = child.attrib["name"]
                    xmltags.extend(list(child))
                elif "decorates" in child.attrib:
                    decorates = child.attrib["decorates"]
                    xmltags.append(child)

                for xtag in xmltags:
                    _update_from_globals(xtag, xmlglobals, child)

                if decorates in result:
                    result[decorates].extend(xmltags)
                else:
                    result[decorates] = xmltags

            #Loop through all the docstrings we found and team them up with
            #their respective module members.
            self._xml_update_modules(result, modules)
def parsexml ( self , xmlstring , modules , source = None ) : result = { } from fortpy . utility import XML_fromstring xmlroot = XML_fromstring ( xmlstring , source ) if xmlroot . tag == "fortpy" and "mode" in xmlroot . attrib and xmlroot . attrib [ "mode" ] == "docstring" : xmlglobals = { } for child in xmlroot . iterfind ( "globals" ) : _update_globals ( list ( child ) , xmlglobals ) _set_global_defaults ( xmlglobals ) for child in xmlroot : if child . tag == "globals" : continue xmltags = [ ] if child . tag == "decorates" and "name" in child . attrib : decorates = child . attrib [ "name" ] xmltags . extend ( list ( child ) ) elif "decorates" in child . attrib : decorates = child . attrib [ "decorates" ] xmltags . append ( child ) for xtag in xmltags : _update_from_globals ( xtag , xmlglobals , child ) if decorates in result : result [ decorates ] . extend ( xmltags ) else : result [ decorates ] = xmltags self . _xml_update_modules ( result , modules )
Parses the docstrings out of the specified xml file.

        :arg source: the path to the file from which the XML string was extracted.