On Mar 20, 2014, at 3:20 AM, åç <zhang_zhang@xxxxxxxx> wrote: [ a = 1; b = { [c = 1; d = 1], [c = 2; d = 2] }; â ] Iâm assuming you are using the C++ API. There could some minor syntax errors in the code below... If you have a string representation of the list of nested ads, then you can use the ClassAdParser class to parse that into the appropriate ExprTree*, and insert that into the parent ad: ClassAd parent_ad; ClassAdParser parser; ExprTree *list = parser.ParseExpression(â{ [c = 1; d = 1], [c = 2; d = 2] }â); parent_ad.Insert( âbâ, list ); If you are building up the child ad objects with ClassAd::InsertAttr() calls, and then want to insert them into the parent ad, you can do this: ClassAd parent_ad; ClassAd *child_ad1 = ...; ClassAd *child_ad1 = ...; std::vector<ExprTree*> v; v.push_back(child_ad1); v.push_back(child_ad2); ExprTree *list = ExprList::MakeExprList( v ); parent_ad.Insert( âbâ, list ); Once you have inserted the list of nested ads in the parent ad, modifying the list by adding or removing ads is not easy, but can be done. I hope that helps. Thanks and regards, Jaime Frey UW-Madison HTCondor Project |