XML format support for the GHMM library.
Imported modules
|
|
from DataStructures import Point2D, EdgeWeight
import EditObjectAttributesDialog
from EditObjectAttributesDialog import EditObjectAttributesDialog, ValidatingString, ValidatingInt, ValidatingFloat, PopupableInt, Probability, DefaultedInt, DefaultedString
from Graph import Graph, SubGraph
import copy
import logging
import string
import sys
import types
import whrandom
from xml.dom.minidom import *
|
Functions
|
|
csvFromList
listFromCSV
removeEmptyTextNodes
toprettyxml
typed_assign
writeContents
writeData
writeXMLData
writeXMLTextNode
|
|
csvFromList
|
csvFromList ( list, perRow=None )
|
|
listFromCSV
|
listFromCSV ( s, type )
|
|
removeEmptyTextNodes
|
removeEmptyTextNodes ( XMLNode )
|
|
toprettyxml
|
toprettyxml ( XMLDoc )
Notice for this function:
minidom.Element.toprettyxml is not so pretty and its output format is not compatible
with XMLIO parser. The particular problem with minidom.toprettyxml is that
it put the text data of a text node on a new line, instead of immediately after the element tag.
Because XMLIO cannot parse this format, thus we need our own pretty print program
|
|
typed_assign
|
typed_assign ( var, val )
|
|
writeContents
|
writeContents (
XMLDoc,
XMLNode,
data,
)
|
|
writeData
|
writeData (
XMLDoc,
XMLNode,
dataKey,
dataValue,
)
|
|
writeXMLData
|
writeXMLData (
XMLDoc,
XMLNode,
dataKey,
XMLData,
)
|
|
writeXMLTextNode
|
writeXMLTextNode (
XMLDoc,
XMLNode,
keyName,
XMLData,
)
|
Classes
|
|
|
|