Ejemplo n.º 1
0
   def openXML(self,filename):
      version = None
      xmlroot = parseXMLFile(filename)  #'http://autosar.org/3.0.2'
      namespace = getXMLNamespace(xmlroot)

      assert (namespace is not None)
      if namespace == 'http://autosar.org/3.0.2': version = 3.0
      if version is None:
         raise NotImplementedError('unsupported autosar vesion: %s'%namespace)
      removeNamespace(xmlroot,namespace)
      self.packageParser = autosar.parser.package_parser.PackageParser(version,self)
      self.version=version
      self.xmlroot = xmlroot
Ejemplo n.º 2
0
    def openXML(self, filename):
        version = None
        xmlroot = parseXMLFile(filename)  #'http://autosar.org/3.0.2'
        namespace = getXMLNamespace(xmlroot)

        assert (namespace is not None)
        if namespace == 'http://autosar.org/3.0.2': version = 3.0
        if version is None:
            raise NotImplementedError('unsupported autosar vesion: %s' %
                                      namespace)
        removeNamespace(xmlroot, namespace)
        self.packageParser = autosar.parser.package_parser.PackageParser(
            version, self)
        self.version = version
        self.xmlroot = xmlroot
Ejemplo n.º 3
0
   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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
    def openXML(self, filename):
        version = None
        xmlroot = parseXMLFile(filename)
        namespace = getXMLNamespace(xmlroot)

        assert (namespace is not None)
        tmp = namespace.split('/')[-1]
        result = re.match(r'(\d+\.\d+)', tmp)
        if result is None:
            result = re.match(r'r(\d+\.\d+)', tmp)
        if result is not None:
            version = float(result.group(1))
        if version is None:
            raise NotImplementedError('unsupported autosar vesion: %s' %
                                      namespace)
        removeNamespace(xmlroot, namespace)
        self.packageParser = autosar.parser.package_parser.PackageParser(
            version, self)
        self.version = version
        self.xmlroot = xmlroot