def set_doc_namespace(self, doc, namespace):
if not self.doc_namespace_set:<EOL><INDENT>self.doc_namespace_set = True<EOL>if validations.validate_doc_namespace(namespace):<EOL><INDENT>doc.namespace = namespace<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT>
Sets the document namespace.
        Raise SPDXValueError if malformed value, CardinalityError
        if already defined.