| Trees | Index | Help |
|---|
| Module BasicClasses :: Class BIXMLWriteable |
|
object --+
|
BIXMLWriteable
BioInfer,
Entity,
Formula,
FormulaNode,
Link,
Linkage,
Linkages,
Ontology,
OntologyNode,
Predicate,
Sentence,
Sentences,
SubToken,
TokenXMLTag which is
a string containing the tag to be used for the object in the XML
output. This tag is used when writing the XML, not when reading the
XML.
persistentAttrs which lists (as strings) the names of
instance variables whose values should be included as attributes in
the XML output. For instance, if an instance contains the variable
id and the string id is in its
persistentAttrs, the attribute id= will be output
in the XML representation of this object. The builtin
str is used to convert values to strings.
persistentAttrs mechanism is not
sufficient. That is, for example, the case when a reference to an
other object is held, and its id should be used as an attribute. In
that case, an object may define a method
computeXMLArgs() which returns an iterable of
two-tuples, where each tuple is (attributeName,attributeValue) - both
strings - that specifies the attribute names and values to be
included into the XML output. It is possible to combine
persistentAttrs with computeXMLArgs().
writeXMLNestedItems method, it
is called so that the object may output any nested objects. It should
do so by calling their writeXML method. See the
definition of writeXMLNestedItems in any of the objects
to see an example.
| Method Summary | |
|---|---|
Outputs the complete XML representation of the given object. | |
Prints the closing tag of the object: </tag>. | |
Writes opening tag into the XML output. | |
Computes the string representation of the object's attributes, which are included into the XML tag. | |
| Inherited from object | |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
| Class Variable Summary | |
|---|---|
list |
persistentAttrs: The list of attributes to be included in the XML output. |
| Method Details |
|---|
writeXML(self, out, indent, **kwArgs)Outputs the complete XML representation of the given object.
|
writeXMLClose(self, out, indent=0)Prints the closing tag of the object: </tag>.
|
writeXMLOpen(self, out, indent=0, closing=False)Writes opening tag into the XML output. Depending on the parameterclosing, the opening will be a simple opening tag
<tag> or a complete tag <tag/>.
|
XMLAttrs(self)Computes the string representation of the object's attributes, which are included into the XML tag. Invokes the mechanism for attribute printing (described above) to obtain all printable attributes of the object
|
| Class Variable Details |
|---|
persistentAttrsThe list of attributes to be included in the XML output. By default an empty list, that is, no attributes are included by default.
|
| Trees | Index | Help |
|---|
| Generated by Epydoc 2.0 on Tue Nov 21 15:32:22 2006 | http://epydoc.sf.net |