08-24-2021 03:04 AM - edited 08-24-2021 03:20 AM
The xml file has the following content:
<Art1>1000</Art1>
<Art2>1010</Art2>
<Art3>1020</Art3>
<Art4>1030</Art4>
<Art5>1040</Art5>
<Art6>1050</Art6>
<Art7>1060</Art7>
<Art8>1070</Art8>
<Art9>1080</Art9>
</Art_List>
I can already read the numbers inside every child. I would like to fill a ring on the panel with the name of childs (Art numbers) and the numbers inside to compare them
Dokument = xml_funktionen_Open_Document (Path);
// Art_list
Childinfos = xml_funktionen_Get_Child_Information (Dokument->hRoot, "Art_list", "", "");
Subchildinfos = xml_funktionen_Get_All_Childs (Childinfos->hHandle);
Subchildinfos = xml_funktionen_Get_All_Childs (Childinfos->hHandle);
if(Childinfos->inumChild <= 0) Main_ERROR(SYS_REF_LADEN_ARTIKEL, SYSTEMFEHLER);
sRef_Data.cArtikelliste = calloc (Childinfos->inumChild*sizeof(char*), 1);
for (int i=0; i<Childinfos->inumChild; i++)
{
sRef_Data.Art_list[i] = calloc ((Subchildinfos->iMax_Child_Value_Length+1)*sizeof(char*)/4, 1);
}
// fill the Art_list
for(int i = 0; i<Childinfos->inumChild; i++)
{
Fmt(sRef_Data.Art_list[i], "%s<%s", Subchildinfos->cChild_Values[i]);
}
sRef_Data.iNum_Art = Childinfos->inumChild;
xml_funktionen_Close_Document(Dokument->hDokument);
Solved! Go to Solution.
08-24-2021 11:07 AM
I don't know which library you have used to read the XML file, but are you aware of the cvixml.fp instrument? With that you can read the XML file and get tag and value for the elements in your file with which to fill your list.
CVI comes also with an example program of how to use the instrument: this is how your XML file looks like when read from XMLSample program:
You can find the example program by using the Example Finder (Help >> Find Examples...) and searching for "XML"