diff options
author | Vadim Revyakin <vadimr@intel.com> | 2007-02-22 12:00:57 +0000 |
---|---|---|
committer | Vadim Revyakin <vadimr@intel.com> | 2007-02-22 12:00:57 +0000 |
commit | 53f7a15ef181776f11836ce183f3f4bceeea9a71 (patch) | |
tree | e6fe23653b227782555771465de056a64d82cf27 /examples | |
parent | 76328a1ba6b9c0e9e8461a860bdaa15ac06c320a (diff) | |
download | wsmancli-53f7a15ef181776f11836ce183f3f4bceeea9a71.tar.gz wsmancli-53f7a15ef181776f11836ce183f3f4bceeea9a71.tar.xz wsmancli-53f7a15ef181776f11836ce183f3f4bceeea9a71.zip |
advancing SER_DEFAULT_NS(namespace) macro for serialization
Diffstat (limited to 'examples')
-rw-r--r-- | examples/serialize.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/examples/serialize.c b/examples/serialize.c index a830ab4..cf481d6 100644 --- a/examples/serialize.c +++ b/examples/serialize.c @@ -183,7 +183,16 @@ macro SER_DEFAULT_NS(<ns>) does not describe any real element but sets default namespace to <ns>. So all SER_* defines after SER_DEFAULT_NS(<ns>) will create elements with namespace <ns>. SER_DEFAULT_NS(NULL) disables - default name prefix. + default name prefix. SER_NS_*(NULL, name) define describes the element + without namespace prefix in any case. + + If element has attributes it must be described in TS by the special structure. + For example XML_TYPE_UINT8 with attributes is described as: + struct {XML_TYPE_UINT8 body; XML_NODE_ATTR *attrs;} + Here attrs is a NULL terminated list XML_NODE_ATTR holding name, + namespace and value of attribute. + Such structures are described by special macros SER_ATTR_* or SER_ATTR_NS_* + in TDO. @@ -266,7 +275,7 @@ SER_STR("CreationClassName", 1), SER_STR("Description", 1), SER_BOOL("DesktopInteract", 1), SER_NS_STR(EX1_NS, "DisplayName", 1), -SER_STR("ErrorControl", 1), +SER_NS_STR(NULL, "ErrorControl", 1), SER_UINT32("ExitCode", 1), SER_STR("InstallDate", 1), SER_STR("Name", 1), @@ -688,15 +697,15 @@ example6() str_attrs[1].next = &str_attrs[2]; SER_START_ITEMS(Dummy) - SER_ATTR_NS_UINT8_FLAGS(NULL, "UINT8", 1, 0), - SER_ATTR_NS_UINT16_FLAGS(NULL, "UINT16", 1, 0), - SER_ATTR_NS_UINT32_FLAGS(NULL, "UINT32", 1, 0), - SER_ATTR_NS_BOOL_FLAGS(NULL, "BOOL", 1, 0), - SER_ATTR_NS_STR_FLAGS(NULL, "STRING", 1, 0), + SER_ATTR_UINT8("UINT8", 1), + SER_ATTR_UINT16("UINT16", 1), + SER_ATTR_UINT32("UINT32", 1), + SER_ATTR_BOOL("BOOL", 1), + SER_ATTR_STR("STRING", 1), SER_END_ITEMS(Dummy); SER_START_ITEMS(Sample) - SER_ATTR_NS_STRUCT_FLAGS(XML_NS_WS_MAN, "STRUCT", 1, 0, Dummy), + SER_ATTR_NS_STRUCT(XML_NS_WS_MAN, "STRUCT", 1, Dummy), SER_END_ITEMS(Sample); WsContextH cntx; |