Helper class: DBSXMLHandler. More...
Public Member Functions | |
def | __init__ |
def | characters |
def | check_results_validity |
def | current_element |
def | endElement |
def | startElement |
Public Attributes | |
current_value | |
element_position | |
results | |
tag_names | |
Static Public Attributes | |
dictionary | mapping |
Helper class: DBSXMLHandler.
XML handler class to parse DBS results. The tricky thing here is that older DBS versions (2.0.5 and earlier) return results in a different XML format than newer versions. Previously the result values were returned as attributes to the `result' element. The new approach returns result values as contents of named elements. The old approach is handled directly in startElement(), the new approach in characters(). NOTE: All results are returned in the form of string values of course!
Definition at line 184 of file cmsHarvester.py.
def cmsHarvester.DBSXMLHandler.__init__ | ( | self, | |
tag_names | |||
) |
Definition at line 217 of file cmsHarvester.py.
def cmsHarvester.DBSXMLHandler.characters | ( | self, | |
content | |||
) |
Definition at line 256 of file cmsHarvester.py.
References cmsHarvester.DBSXMLHandler.current_element(), and cmsHarvester.DBSXMLHandler.tag_names.
def cmsHarvester.DBSXMLHandler.check_results_validity | ( | self | ) |
Make sure that all results arrays have equal length. We should have received complete rows from DBS. I.e. all results arrays in the handler should be of equal length.
Definition at line 267 of file cmsHarvester.py.
References cmsHarvester.DBSXMLHandler.results.
def cmsHarvester.DBSXMLHandler.current_element | ( | self | ) |
Definition at line 264 of file cmsHarvester.py.
References cmsHarvester.DBSXMLHandler.element_position.
Referenced by cmsHarvester.DBSXMLHandler.characters(), and cmsHarvester.DBSXMLHandler.endElement().
def cmsHarvester.DBSXMLHandler.endElement | ( | self, | |
name | |||
) |
Definition at line 243 of file cmsHarvester.py.
References python.multivaluedict.append(), cmsHarvester.DBSXMLHandler.current_element(), cmsHarvester.DBSXMLHandler.current_value, join(), cmsHarvester.DBSXMLHandler.results, and cmsHarvester.DBSXMLHandler.tag_names.
def cmsHarvester.DBSXMLHandler.startElement | ( | self, | |
name, | |||
attrs | |||
) |
Definition at line 224 of file cmsHarvester.py.
cmsHarvester.DBSXMLHandler.current_value |
Definition at line 227 of file cmsHarvester.py.
Referenced by cmsHarvester.DBSXMLHandler.endElement().
cmsHarvester.DBSXMLHandler.element_position |
Definition at line 220 of file cmsHarvester.py.
Referenced by cmsHarvester.DBSXMLHandler.current_element().
|
static |
Definition at line 205 of file cmsHarvester.py.
cmsHarvester.DBSXMLHandler.results |
Definition at line 222 of file cmsHarvester.py.
Referenced by cmsHarvester.DBSXMLHandler.check_results_validity(), and cmsHarvester.DBSXMLHandler.endElement().
cmsHarvester.DBSXMLHandler.tag_names |
Definition at line 221 of file cmsHarvester.py.
Referenced by cmsHarvester.DBSXMLHandler.characters(), and cmsHarvester.DBSXMLHandler.endElement().