qwwq
No notes
Syntax:
No syntax
QStringList XmlParserCLS::xmlGenericItemValueRetriever(const QString& DocName,const QString& GroupName, const QStringList& TagList){ //"ConvertedName-ITM"<<"SeqNum-ITM"<<"Path-ITM"<<"Type-ITM"<<"ShowStatus-ITM"<<"MarkOrNot-ITM"<<"DrawingNumber-ITM"<<"Description-ITM"<<"Qty-ITM"<<"SellQty-ITM"<<"ItemMass-ITM"<<"PackHeight-ITM"<<"PackBreadth-ITM"<<"UnitPrice-ITM"<<"Group-ITM"<<"MasterMaterial-ITM"<<"CostPolicy-ITM";
//"ConvertedName-ITM"<<"SeqNum-ITM"<<"Path-ITM"<<"Type-ITM"<<"ShowStatus-ITM"<<"MarkOrNot-ITM"<<"DrawingNumber-ITM"<<"Description-ITM"<<"Qty-ITM"<<"SellQty-ITM"<<"ItemMass-ITM"<<"PackHeight-ITM"<<"PackBreadth-ITM"<<"UnitPrice-ITM"<<"Group-ITM"<<"MasterMaterial-ITM";
QStringList ReturnList;
//Get root element
QDomNodeList QDNL=doc.elementsByTagName("TransDoc");
QDomNode QDN=QDNL.item(0);
QDomElement root=QDN.toElement();
if(!QDNL.isEmpty()){ //If at least one root was found
//Get all the Bundles and their codes
QDomNodeList QDNL=doc.elementsByTagName("Item");
int NumOfItems=QDNL.count();
QString ThisGroupName;
QDomNode QDNCI;
QString ThisDocName;
for(int i=0; i<NumOfItems; i++){
QDNCI=QDNL.item(i);
ThisGroupName=QDNCI.firstChildElement("Group-ITM").toElement().text();
ThisDocName=QDNCI.firstChildElement("OriginalName-ITM").toElement().text();
if(((ThisGroupName==GroupName)||(GroupName==GroupWildCard))&&(ThisDocName==DocName)){
for(int j=0; j<TagList.count(); j++){
if(TagList[j]=="ConvertedName-ITM"){
ReturnList<<QDNCI.firstChildElement("ConvertedName-ITM").toElement().text();
}
else if(TagList[j]=="SeqNum-ITM"){
ReturnList<<QDNCI.firstChildElement("SeqNum-ITM").toElement().text();
}
else if(TagList[j]=="Path-ITM"){
ReturnList<<QDNCI.firstChildElement("Path-ITM").toElement().text();
}
else if(TagList[j]=="Type-ITM"){
ReturnList<<QDNCI.firstChildElement("Type-ITM").toElement().text();
}
else if(TagList[j]=="ShowStatus-ITM"){
ReturnList<<QDNCI.firstChildElement("ShowStatus-ITM").toElement().text();
}
else if(TagList[j]=="MarkOrNot-ITM"){
ReturnList<<QDNCI.firstChildElement("MarkOrNot-ITM").toElement().text();
}
else if(TagList[j]=="DrawingNumber-ITM"){
ReturnList<<QDNCI.firstChildElement("DrawingNumber-ITM").toElement().text();
}
else if(TagList[j]=="Description-ITM"){
ReturnList<<QDNCI.firstChildElement("Description-ITM").toElement().text();
}
else if(TagList[j]=="Qty-ITM"){
ReturnList<<QDNCI.firstChildElement("Qty-ITM").toElement().text();
}
else if(TagList[j]=="SellQty-ITM"){
ReturnList<<QDNCI.firstChildElement("SellQty-ITM").toElement().text();
}
else if(TagList[j]=="ItemMass-ITM"){
ReturnList<<QDNCI.firstChildElement("ItemMass-ITM").toElement().text();
}
else if(TagList[j]=="PackHeight-ITM"){
ReturnList<<QDNCI.firstChildElement("PackHeight-ITM").toElement().text();
}
else if(TagList[j]=="PackBreadth-ITM"){
ReturnList<<QDNCI.firstChildElement("PackBreadth-ITM").toElement().text();
}
else if(TagList[j]=="UnitPrice-ITM"){
ReturnList<<QDNCI.firstChildElement("UnitPrice-ITM").toElement().text();
}
else if(TagList[j]=="Group-ITM"){
ReturnList<<QDNCI.firstChildElement("Group-ITM").toElement().text();
}
else if(TagList[j]=="MasterMaterial-ITM"){
ReturnList<<QDNCI.firstChildElement("MasterMaterial-ITM").toElement().text();
}
else if(TagList[j]=="CostPolicy-ITM"){
ReturnList<<QDNCI.firstChildElement("CostPolicy-ITM").toElement().text();
}
else
ReturnList<<"NotDetected";
}//for j
break;
}
}
}//if root node found
else{
QMessageBox::critical(parent,"OSTClient","From xmlGenericItemValueRetriever() No valid document found to add Item to!","");
}
return ReturnList;
}//xmlGenericItemValueRetriever(){