diff options
author | David Sommerseth <davids@redhat.com> | 2009-05-19 15:29:56 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-05-20 14:19:57 +0200 |
commit | 599642f7370cb3f2fbf5c079c20269318d5a775f (patch) | |
tree | 3d172f9e2354a34cb9bc66f045d76d5172fea8d3 /src/xmlpythonizer.h | |
parent | 52f936c82d9098b2a64986228ebc1e9109828ac9 (diff) | |
download | python-dmidecode-599642f7370cb3f2fbf5c079c20269318d5a775f.tar.gz python-dmidecode-599642f7370cb3f2fbf5c079c20269318d5a775f.tar.xz python-dmidecode-599642f7370cb3f2fbf5c079c20269318d5a775f.zip |
Added support for value type 'list:dict' for field mapping
This builds up a list of dicts. Syntax is:
<Map keytype="constant" key="TestData"
valuetype="list:dict" value="/xml/XPath/to/nodes">
<Map keytype="constant" key="field"
valuetype="string" key="ValueNode"/>
</Map>
The parser will iterate all nodes defined in the @value attribute
and the root path will of the nested mapping will be using the path
in @value as the root path for further parsing.
Diffstat (limited to 'src/xmlpythonizer.h')
-rw-r--r-- | src/xmlpythonizer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmlpythonizer.h b/src/xmlpythonizer.h index 62134b4..e659340 100644 --- a/src/xmlpythonizer.h +++ b/src/xmlpythonizer.h @@ -29,7 +29,7 @@ typedef enum ptzTYPES_e { ptzCONST, ptzSTR, ptzINT, ptzFLOAT, ptzBOOL, ptzLIST_STR, ptzLIST_INT, ptzLIST_FLOAT, ptzLIST_BOOL, - ptzDICT } ptzTYPES; + ptzDICT, ptzLIST_DICT } ptzTYPES; typedef struct ptzMAP_s { char *rootpath; // XML root path for the data - if NULL, XML document is the root document. @@ -43,7 +43,7 @@ typedef struct ptzMAP_s { char *list_index ; // Only to be used on fixed lists int emptyIsNone; // If set to 1, empty input (right trimmed) strings sets the result to Py_None char *emptyValue; // If set, this value will be used when input is empty - struct ptzMAP_s *child; // Only used for type_value == pyDICT + struct ptzMAP_s *child; // Only used for type_value == (ptzDICT || ptzLIST_DICT) struct ptzMAP_s *next; // Pointer chain } ptzMAP; |