MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / getNamespace

Method getNamespace

vulnerabilities/lib_oval.py:863–887  ·  view source on GitHub ↗

Returns the URI of the namespace or None if this node does not have a namepsace

(self)

Source from the content-addressed store, hash-verified

861 return self.element.tag
862
863 def getNamespace(self):
864 """
865 Returns the URI of the namespace or None if this node does not have a namepsace
866 """
867 if not self.element or self.element is None:
868 return None
869
870 tag = self.element.tag
871
872 if not tag or tag is None:
873 return None
874
875 # If the oval ID does not contain a namespace, then we can't determine the schema shortname
876 if not "}" in tag:
877 return None
878
879 try:
880 position = tag.find("}")
881 if position < 0:
882 return None
883
884 namespace = tag[:position]
885 return namespace[1:]
886 except Exception:
887 return None
888
889 def getSchemaShortName(self):
890 """"""

Callers 1

writeToFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected