Ejemplo n.º 1
0
 public override object Execute(Executive engine, object[] lval, out bool proceed)
 {
     DataResolver resolver = (DataResolver)engine.CurrentResolver();
     object res = Lisp.Cons(ID.XmlValueConcat);
     object tail = res;
     if (lval.Length == 0)
     {
         foreach (ColumnBinding b in resolver.Bindings)
         {
             Lisp.Rplacd(tail, Lisp.Cons(Lisp.List(ID.XmlValueElem, b.Name,
                 Lisp.List(Funcs.Weak, ATOM.Create(null, new string[] { b.TableName, b.Name }, false)), XmlValueOption.EmptyOnNull)));
             tail = Lisp.Cdr(tail);
         }
     }
     else
         foreach (object o in lval)
         {
             if (Lisp.IsFunctor(o, DataSelector.Table))
             {
                 string tableName = (string)Lisp.Second(o);
                 XmlValueOption option = (XmlValueOption)Lisp.Third(o);
                 foreach (ColumnBinding b in resolver.Bindings)
                     if (b.TableName.Equals(tableName))
                     {
                         Lisp.Rplacd(tail, Lisp.Cons(Lisp.List(ID.XmlValueElem, b.Name,
                             Lisp.List(Funcs.Weak,  ATOM.Create(null, new string[] { b.TableName, b.Name }, false)), option)));
                         tail = Lisp.Cdr(tail);
                     }
             }
             else
             {
                 Lisp.Rplacd(tail, Lisp.Cons(o));
                 tail = Lisp.Cdr(tail);
             }
         }
     proceed = true;
     return res;
 }
Ejemplo n.º 2
0
 public override object Execute(Executive engine, object[] lval, out bool proceed)
 {
     DataResolver resolver = (DataResolver)engine.CurrentResolver();
     object elem = lval[0];
     string tableName = (string)lval[1];
     XmlValueOption option = (XmlValueOption)lval[2];
     foreach (ColumnBinding b in resolver.Bindings)
         if (String.IsNullOrEmpty(tableName) || b.TableName.Equals(tableName))
             elem = Lisp.List(ID.XmlValueAtt, elem, b.Name,
                 Lisp.List(Funcs.Weak, ATOM.Create(null, new string[] { b.TableName, b.Name }, false)), option);
     proceed = true;
     return elem;
 }