Date: Sun, 23 Sep 2012 12:45:50 +0800 From: Yuzhu Chen <yuzhu.chen@ericsson.com> To: "mav@alkar.net" <mav@alkar.net> Cc: "ports@FreeBSD.org" <ports@FreeBSD.org> Subject: FreeBSD Port: libpdel-0.5.3_4 Message-ID: <9732C4B83593D04A9A8CB973178ECE4D497572EC07@ESGSCCMS0001.eapac.ericsson.se>
next in thread | raw e-mail | index | archive | help
Hi Mav, Sorry for disturbing! We are using libpdel. In our souce code, structs_xml_input is called with STRUCTS_XML_LOOSE which= means unrecognised xml tags will be ignored. We are doing some tests about this. The xml file we are using is as follows and corresponding structs_type stru= cts_field are well defined. <?xml version=3D"1.0" standalone=3D"yes"?> <AtmService_cdb_array> <AtmService_cdb_entry> <moid><class>AtmService</class><slot>3</slot><port>1</port></moid> <data><numOfUsedAtmIwf>0</numOfUsedAtmIwf><transportPort><class>747</clas= s><slot>3</slot><port>1</port></transportPort></data> </AtmService_cdb_entry> <AtmService_cdb_entry> <moid><class>AtmService</class><slot>4</slot><port>1</port></moid> <data><numOfUsedAtmIwf>1</numOfUsedAtmIwf><transportPort><class>747</clas= s><slot>4</slot><port>1</port></transportPort></data> </AtmService_cdb_entry> </AtmService_cdb_array> When an un necessary xml tag is added into the xml file(shown below) and co= rresponding structs_type and structs_field is kept unchanged. The xml file = can no be parsed correctedly. <?xml version=3D"1.0" standalone=3D"yes"?> <AtmService_cdb_array> <AtmService_cdb_entry> <moid><class>AtmService</class><slot>3</slot><port>1</port></moid> <data><for_test>1234</for_test><numOfUsedAtmIwf>0</numOfUsedAtmIwf><trans= portPort><class>747</class><slot>3</slot><port>1</port></transportPort></da= ta> </AtmService_cdb_entry> <AtmService_cdb_entry> <moid><class>AtmService</class><slot>4</slot><port>1</port></moid> <data><for_test>1234</for_test><numOfUsedAtmIwf>1</numOfUsedAtmIwf><trans= portPort><class>747</class><slot>4</slot><port>1</port></transportPort></da= ta> </AtmService_cdb_entry> </AtmService_cdb_array> Xml tags after the first <for_test>1234</for_test> can not be handled corre= ctly any more. Looks like structs_xml_pop not be called for unrecognised tags after lookin= g through source code of libpdel. In the function of structs_xml_unnest, maybe "goto done;" need to be added = to avoid this problem. static void structs_xml_unnest(struct xml_input_info *info, const XML_Char = *name) { struct xmlinput_stackframe *const frame =3D &info->stack[info->dept= h]; const struct structs_type *type; const char *s; char ebuf[64]; void *data; /* Skip if any errors */ if (info->error) return; if (info->skip) { info->skip--; goto done; return; } ... May I have your comments? Thank you! BR/ Yuzhu Chen
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9732C4B83593D04A9A8CB973178ECE4D497572EC07>