def openXML(self,filename): xmlroot = parseXMLFile(filename) namespace = getXMLNamespace(xmlroot) assert (namespace is not None) (major, minor, patch, schema) = parseAutosarVersionAndSchema(xmlroot) removeNamespace(xmlroot,namespace) self.version=float('%s.%s'%(major,minor)) self.major=major self.minor=minor self.patch=patch self.schema=schema self.xmlroot = xmlroot if self.packageParser is None: self.packageParser = autosar.parser.package_parser.PackageParser(self.version) self._registerDefaultElementParsers(self.packageParser)
def openXML(self,filename): xmlroot = parseXMLFile(filename) namespace = getXMLNamespace(xmlroot) assert (namespace is not None) (major, minor, patch, release, schema) = parseAutosarVersionAndSchema(xmlroot) removeNamespace(xmlroot,namespace) self.version=float('%s.%s'%(major,minor)) self.major = major self.minor = minor self.patch = patch self.release = release self.schema = schema self.xmlroot = xmlroot if self.packageParser is None: self.packageParser = autosar.parser.package_parser.PackageParser(self.version) self._registerDefaultElementParsers(self.packageParser)