Markup very good a C + + library, directly download the source code from the official website to add the relevant documents to the project compilation. Examples are as follows:
XML file:
<?xml version= "1.0" encoding= "Utf-8"?>
<orderStaDic>
<orderSta>
<ORDERSTACODE>04</ORDERSTACODE>
<ORDERSTANAME>??? ~??? Л</orderstaname>
</orderSta>
<orderSta>
<ORDERSTACODE>03</ORDERSTACODE>
<ORDERSTANAME>??? ~???? </ORDERSTANAME>
</orderSta>
</orderStaDic>
C + + parsing code:
void Loaddicxml ()
{
CMarkup XML;
String str= "Goodsdic.xml";
BOOL Xx=xml. Load (str);
Xml. Resetmainpos ();
int id=0;
while (XML. Findchildelem ("Ordersta"))
{
Goodsdics M_GD;
Xml. Intoelem ();
Xml. Findchildelem ("Orderstacode");
String codestr= XML. Getchilddata ();
strcpy (M_gd.statecode,codestr.c_str ());
Xml. Findchildelem ("Orderstaname");
String namestr= XML. Getchilddata ();
strcpy (M_gd.statename,namestr.c_str ());
QString STRTMP1 (M_gd.statecode);
QString STRTMP2 (m_gd.statename);
Qmessagebox::warning (This, "666666", tr (m_gd.statecode) +tr (m_gd.statename));
Map_psstatesno.insert (STRTMP1,M_GD);
Map_psstatesmsg.insert (STRTMP2,M_GD);
Xml. Outofelem ();
}
}
This I also loaded into QT use, feel very convenient to use.
The markup of C + + library