{core}
Class to store the Level, Version and XML namespace information of an SBML extension package.
def libsbml.SBMLNamespaces.addNamespaces |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
inherited |
Python method signature(s):
addNamespaces(SBMLNamespaces self, XMLNamespaces xmlns)
int
Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.
The following code gives an example of how one could add the XHTML namespace to the list of namespaces recorded by the top-level <sbml>
element of a model. It gives the new namespace a prefix of html
.
sbmlDoc = None
try:
sbmlDoc = SBMLDocument(3, 1)
except ValueError:
# Do something to handle exceptional situation. Candidate
# causes include invalid combinations of SBML Level and Version
# (impossible if hardwired as given here), running out of memory, and
# unknown system exceptions.
namespaces = sbmlDoc.getNamespaces()
if namespaces == None:
# Do something to handle case of no namespaces.
status = namespaces.add('http://www.w3.org/1999/xhtml', 'html')
if status != LIBSBML_OPERATION_SUCCESS:
# Do something to handle failure.
- Parameters
-
xmlns | the XML namespaces to be added. |
- Returns
- integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.SBMLNamespaces.addPackageNamespace |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
inherited |
Python method signature(s):
addPackageNamespace(SBMLNamespaces self, string pkgName, long pkgVersion, string prefix="")
int
addPackageNamespace(SBMLNamespaces self, string pkgName, long pkgVersion)
int
Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.
The SBML Level and SBML Version of this object is used.
- Parameters
-
pkgName | the string of package name (e.g. 'layout', 'multi') |
pkgVersion | the package version |
prefix | the prefix of the package namespace to be added. The package's name will be used if the given string is empty (default). |
- Returns
- integer value indicating success/failure of the function. The possible values returned by this function are:
- Note
- An XML namespace of a non-registered package extension can't be added by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
- See also
- addNamespace()
def libsbml.SBMLNamespaces.getNamespaces |
( |
|
self, |
|
|
|
args |
|
) |
| |
|
inherited |
Python method signature(s):
getNamespaces(SBMLNamespaces self)
XMLNamespaces
getNamespaces(SBMLNamespaces self)
XMLNamespaces
Get the XML namespaces list for this SBMLNamespaces object.
- SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.
The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.
- Returns
- the XML namespaces of this SBMLNamespaces object.