i using library libxml2 parse xml document. , saw xmlhashtable
in library. possible keys of xmlhashtable
? want store keys in array.
the xml document is:
<?xml version="1.0" encoding="utf-8"?> <?type-proto key="mipregistrationrequest" value="mip" ?> <?avp-proto key="example-avp" value="data" ?> <!doctype dictionary system "dictionary.dtd" [ <!-- files added here need added makefile.am , packaging/nsis/wireshark.nsi --> <!entity nasreq system "nasreq.xml"> <!entity eap system "eap.xml"> <!entity mobileipv4 system "mobileipv4.xml"> <!entity chargecontrol system "chargecontrol.xml"> <!entity sunping system "sunping.xml"> <!entity tgpp system "tgpp.xml"> <!entity tgpp2 system "tgpp2.xml"> <!entity sip system "sip.xml"> <!entity etsie2e4 system "etsie2e4.xml"> <!entity ericsson system "ericsson.xml"> <!entity mobileipv6 system "mobileipv6.xml"> <!entity cisco system "cisco.xml"> <!entity starent system "starent.xml"> <!entity vodafone system "vodafone.xml"> <!entity alcatellucent system "alcatellucent.xml"> <!entity nokia system "nokia.xml"> <!entity nokiasolutionsandnetworks system "nokiasolutionsandnetworks.xml"> <!entity hp system "hp.xml"> <!entity oracle system "oracle.xml"> <!entity custom system "custom.xml"> ]> <dictionary> ... <dictionary>
trying keys of external (parsed) entities (such nasreq, eap etc):
ddict_t *ddict_scan(const char* system_directory, const char* filename) { char *path = g_strconcat((const gchar*) system_directory, (const gchar*)filename, (const gchar *)'\0'); xmldocptr p1 = getdoc((const char *)path); xmlentitiestableptr ptr2 = p1->intsubset->entities; //to added }
the type of xmlentitiestable
xmlhashtable
.
there xmlhashscan() function (and pickier relatives), can used have user-provided xmlhashscanner function called library each entry in xmlhashtable
. xmlhashscanner
given name
of each entry parameter, should easy assemble list of keys way.
Comments
Post a Comment