Index: /trunk/include/core/RpLibrary.h
===================================================================
--- /trunk/include/core/RpLibrary.h	(revision 223)
+++ /trunk/include/core/RpLibrary.h	(revision 224)
@@ -22,8 +22,11 @@
 #include <time.h>
 
+#include <list>
+
 /* indentation size (in whitespaces) */
 #define INDENT_SIZE 4
 #define CREATE_PATH 1
 #define NO_CREATE_PATH 0
+#define E_QUEUE_SIZE 100
 
 #ifndef _RpLIBRARY_H 
@@ -38,4 +41,10 @@
         RpLibrary* element (std::string path = "");
         RpLibrary* parent (std::string path = "");
+
+        std::list<std::string> entities  (std::string path = "");
+        std::list<std::string> value     (std::string path = "");
+        std::list<std::string> diff      ( RpLibrary* otherLib,
+                                            std::string path);
+
 
         // should return RpObject& but for simplicity right now it doesnt
@@ -78,6 +87,4 @@
         std::string nodeComp();
         std::string nodePath();
-
-        int isvalid();
 
         void result();
Index: /trunk/src/core/RpLibrary.cc
===================================================================
--- /trunk/src/core/RpLibrary.cc	(revision 223)
+++ /trunk/src/core/RpLibrary.cc	(revision 224)
@@ -501,4 +501,263 @@
 
 /**********************************************************************/
+// METHOD: entities()
+/// Search the path of a xml tree and return its next entity.
+/**
+ * It is the user's responsibility to delete the object when 
+ * they are finished using it?, else i need to make this static
+ */
+
+std::list<std::string> 
+RpLibrary::entities  (std::string path)
+{
+    std::list<std::string> queue;
+    std::list<std::string>::iterator iter;
+    std::list<std::string> retList;
+    std::list<std::string> childList;
+    std::list<std::string>::iterator childIter;
+
+    RpLibrary* ele = NULL;
+
+    RpLibrary* child = NULL;
+    std::string childType = "";
+    std::string childPath = "";
+    std::string paramsPath = "";
+
+    RpLibrary* cchild = NULL;
+    std::string cchildType = "";
+    std::string cchildPath = "";
+
+    queue.push_back(path);
+    iter = queue.begin();
+
+    while( iter != queue.end() ) {
+        ele = this->element(*iter);
+        child = NULL;
+
+        while ( (child = ele->children("",child)) != NULL ) {
+            childList.push_back(child->nodeComp());
+        }
+
+        childIter = childList.begin();
+
+        while (childIter != childList.end()) {
+            child = ele->element(*childIter);
+
+            childType = child->nodeType();
+            childPath = child->nodePath();
+            if ( (childType == "group") || (childType == "phase") ) {
+                // add this path to the queue for paths to search
+                queue.push_back(childPath);
+            }
+            else if (childType == "structure") {
+                // add this path to the return list
+                retList.push_back(child->nodeComp());
+
+                // check to see if there is a ".current.parameters" node
+                // if so, add them to the queue list for paths to search
+                paramsPath = childPath + ".current.parameters";
+                if (child->element(paramsPath) != NULL) {
+                    queue.push_back(paramsPath);
+                }
+            }
+            else {
+                // add this path to the return list
+                retList.push_back(child->nodeComp());
+
+                // look for embedded groups and phases
+                // add them to the queue list for paths to search
+                cchild = NULL;
+                while ( (cchild = child->children("",cchild)) != NULL ) {
+                    cchildType = cchild->nodeType();
+                    cchildPath = cchild->nodePath();
+                    if ( (cchildType == "group") || (cchildType == "phase") ) {
+                        // add this path to the queue for paths to search
+                        queue.push_back(cchildPath);
+                    }
+                }
+            }
+
+            childList.erase(childIter);
+            childIter = childList.begin();
+        }
+
+        queue.erase(iter);
+        iter = queue.begin();
+    }
+
+    return retList;
+}
+
+/**********************************************************************/
+// METHOD: diff()
+/// find the differences between two xml trees.
+/**
+ */
+
+std::list<std::string>
+RpLibrary::diff (RpLibrary* otherLib, std::string path)
+{
+
+    std::list<std::string> thisVal; // two node list of specific entity's value
+    std::list<std::string> otherVal; // two node list of specific entity's value
+
+    std::list<std::string> thisv; // list of this library's entities
+    std::list<std::string>::iterator thisIter;
+
+    std::list<std::string> otherv; // list of other library's entities
+    std::list<std::string>::iterator otherIter;
+
+    std::list<std::string> retList;
+
+    std::string entry = "";
+    std::string thisSpath = "";  // temp string
+    std::string otherSpath = ""; // temp string
+
+    if ( (!this->root) || (!otherLib->root) ) {
+        // library doesn't exist, do nothing;
+        return retList;
+    }
+
+    thisv = this->entities(path);
+    otherv = otherLib->entities(path);
+
+    thisIter = thisv.begin();
+
+    while (thisIter != thisv.end() ) {
+        // reset otherIter for a new search.
+        otherIter = otherv.begin();
+        while ( (otherIter != otherv.end()) && (*otherIter != *thisIter) ) {
+            otherIter++;
+        }
+
+        thisSpath = path + "." + *thisIter;
+
+        if (otherIter == otherv.end()) {
+            // we've reached the end of the search 
+            // and did not find anything, mark this as a '-'
+            thisVal = this->value(thisSpath);
+            retList.push_back("-");
+            retList.push_back(thisSpath);
+            retList.push_back(thisVal.front());
+            retList.push_back("");
+        }
+        else {
+
+            otherSpath = path + "." + *otherIter;
+
+            thisVal = this->value(thisSpath);
+            otherVal = otherLib->value(otherSpath);
+            if (thisVal.back() != otherVal.back()) {
+                // add the difference to the return list
+                retList.push_back("c");
+                retList.push_back(otherSpath);
+                retList.push_back(thisVal.front());
+                retList.push_back(otherVal.front());
+            }
+
+            // remove the last processed value from otherv
+            otherv.erase(otherIter);
+        }
+
+        // increment thisv's iterator.
+        thisIter++;
+    }
+
+    // add any left over values in otherv to the return list
+    otherIter = otherv.begin();
+    while ( otherIter != otherv.end() ) {
+
+        otherSpath = path + "." + *otherIter;
+
+        otherVal = otherLib->value(otherSpath);
+
+        retList.push_back("+");
+        retList.push_back(otherSpath);
+        retList.push_back(otherVal.front());
+        retList.push_back("");
+
+        otherv.erase(otherIter);
+        otherIter = otherv.begin();
+    }
+
+    return retList;
+}
+
+/**********************************************************************/
+// METHOD: value(path)
+/// find the differences between two xml trees.
+/**
+ */
+
+std::list<std::string>
+RpLibrary::value (std::string path)
+{
+    std::list<std::string> retArr;
+
+    std::string raw = "";
+    std::string val = "";
+
+    RpLibrary* ele = NULL;
+    RpLibrary* tele = NULL;
+
+    int childCount = 0;
+    std::stringstream valStr;
+
+    ele = this->element(path);
+
+    if (ele != NULL ) {
+
+        if (ele->nodeType() == "structure") {
+            raw = path;
+            // try to find a label to represent the structure
+            val = ele->get("about.label");
+
+            if (val == "") {
+               val = ele->get("current.about.label");
+            }
+
+            if (val == "") {
+               tele = ele->element("current");
+               if ( (tele != NULL) && (tele->nodeComp() != "") ) {
+                   tele->children("components",NULL,"",&childCount);
+                   valStr << "<structure> with " << childCount  << " components";
+                   val = valStr.str();
+               }
+            }
+
+        }
+        /*
+        else if (ele->nodeType() == "number") {
+            retArr[0] = "";
+            retArr[1] = "";
+            if ( (tele = ele->element("current")) != NULL) {
+                retArr[0] = tele->get();
+                retArr[1] = retArr[0];
+            }
+            else if ( (tele = ele->element("default")) != NULL) {
+                retArr[0] = tele->get();
+                retArr[1] = retArr[0];
+            }
+        }
+        */
+        else {
+            raw = "";
+            if ( (tele = ele->element("current")) != NULL) {
+                raw = tele->get();
+            }
+            else if ( (tele = ele->element("default")) != NULL) {
+                raw = tele->get();
+            }
+            val = raw;
+        }
+    }
+
+    retArr.push_back(raw);
+    retArr.push_back(val);
+
+    return retArr;
+}
+
+/**********************************************************************/
 // METHOD: parent()
 /// Search the path of a xml tree and return its parent.
@@ -885,9 +1144,8 @@
     if (ele) {
         scew_element_free(ele);
-        if (setNULL) {
+        if (setNULL != 0) {
             // this is the case where user specified an empty path.
             // the object is useless, and will be deleted.
             this->root = NULL;
-            delete this;
             retLib = NULL;
         }
@@ -988,21 +1246,4 @@
 
     return _node2path(root);
-}
-
-/**********************************************************************/
-// METHOD: isvalid()
-/// Returns true if the library is a valid Rappture Object with a document root
-/**
- */
-
-int
-RpLibrary::isvalid ()
-{
-    if (!this->root) {
-        // library doesn't exist, return false;
-        return 0;
-    }
-
-    return 1;
 }
 
Index: /trunk/src/tcl/README
===================================================================
--- /trunk/src/tcl/README	(revision 223)
+++ /trunk/src/tcl/README	(revision 224)
@@ -4,3 +4,3 @@
 
 within tclsh
-    package require RapptureLibrary
+    package require Rappture
Index: /trunk/src/tcl/src/RpLibraryTclInterface.cc
===================================================================
--- /trunk/src/tcl/src/RpLibraryTclInterface.cc	(revision 223)
+++ /trunk/src/tcl/src/RpLibraryTclInterface.cc	(revision 224)
@@ -3,8 +3,6 @@
  *  Rappture::library
  *
- *  This is an interface to the system getrlimit() and setrlimit()
- *  routines.  It allows you to get/set resource limits for child
- *  executables.  We use this in Rappture::exec, for example, to make
- *  sure that jobs don't run forever or fill up the disk.
+ *  This is an interface to the rappture library module.
+ *  It allows you to create rappture library objects.
  * ======================================================================
  *  AUTHOR:  Derrick Kearney, Purdue University
@@ -19,4 +17,5 @@
 // #include <typeinfo.h>
 #include "core/RpLibrary.h"
+#include <sstream>
 
 #ifdef __cplusplus
@@ -38,7 +37,11 @@
 static int RpTclLibCopy   _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
                                         int argc, const char *argv[]    ));
+static int RpTclLibDiff   _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
+                                        int argc, const char *argv[]    ));
 static int RpTclLibElem   _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
                                         int argc, const char *argv[]    ));
 static int RpTclLibGet    _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
+                                        int argc, const char *argv[]    ));
+static int RpTclLibIsa    _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
                                         int argc, const char *argv[]    ));
 static int RpTclLibParent _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp,
@@ -65,6 +68,8 @@
     {"copy", 2, (Blt_Op)RpTclLibCopy, 5, 6,
         "<path> from ?<xmlobj>? <path>",},
+    {"diff", 1, (Blt_Op)RpTclLibDiff, 3, 3, "<xmlobj>",},
     {"element", 1, (Blt_Op)RpTclLibElem, 2, 5, "?-as <fval>? ?<path>?",},
     {"get", 1, (Blt_Op)RpTclLibGet, 2, 3, "?<path>?",},
+    {"isa", 1, (Blt_Op)RpTclLibIsa, 3, 3, "<objType>",},
     {"parent", 2, (Blt_Op)RpTclLibParent, 2, 5, "?-as <fval>? ?<path>?",},
     {"put", 2, (Blt_Op)RpTclLibPut, 2, 8,
@@ -76,4 +81,6 @@
 
 static int nRpLibOps = sizeof(rpLibOps) / sizeof(Blt_OpSpec);
+
+#define RAPPTURE_OBJ_TYPE "::Rappture::LibraryObj"
 
 #ifdef __cplusplus
@@ -115,46 +122,34 @@
 {
     RpLibrary *rpptr = NULL;
-    RpLibrary *testObj = NULL;
     std::string libName = "";
     int noerr = 0;
-    Tcl_CmdInfo* infoPtr = NULL;  // pointer to the command info
+    std::stringstream result;
+    Tcl_CmdInfo info;  // pointer to the command info
+
 
     if ( (argc > 2) && (strncmp(argv[1],"isvalid",7) == 0) ) {
+        result.str("0");
         if (argc != 3) {
-            std::cout << "wrong # args: should be \"" << argv[0] 
-                << " isvalid object\"" << std::endl;
+            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+                "\": isvalid object", 
+                (char*)NULL);
             return TCL_ERROR;
         }
 
-        libName = std::string(argv[2]);
-        std::cout << "argv[2] = " << argv[2] << std::endl;
-        std::cout << "interp = " << interp << std::endl;
-        noerr = Tcl_GetCommandInfo(interp, libName.c_str(), infoPtr);
-        std::cout << "interp = " << interp << std::endl;
-        if (noerr && infoPtr) {
-            testObj = (RpLibrary*) (infoPtr->clientData);
-            // if ( (testObj) && (typeid(RpLibrary) == typeid(testObj)) ) {
-            if (testObj) {
-                // return testObj->isvalid();
-                // need a way to try this and catch any errors
-                try {
-                    testObj->isvalid();
-                    return 1; // return true
-                }
-                catch (const std::exception& e) {
-                    return 0; // return false
-                }
-            }
-            else {
-                return 0; // return false
-            }
-        }
-        else {
-            return 0; // return false
-        }
+        noerr = Tcl_GetCommandInfo(interp, argv[2], &info);
+        if (noerr == 1) {
+            if (info.proc == &RpLibCallCmd) {
+                result.clear();
+                result.str("1");
+            }
+        }
+
+        Tcl_ResetResult(interp);
+        Tcl_AppendResult(interp, result.str().c_str(), (char*)NULL);
+        return TCL_OK;
     }
 
     if (argc != 2) {
-        std::cout << "usage: " << argv[0] << " <xmlfile>" << std::endl;
+        Tcl_AppendResult(interp, "usage: ", argv[0], " <xmlfile>",(char*)NULL);
         return TCL_ERROR;
     }
@@ -165,7 +160,5 @@
     libName = rpLib2command(interp,rpptr);
 
-    Tcl_ResetResult(interp);
     Tcl_AppendResult(interp, libName.c_str(), (char*)NULL);
-
     return TCL_OK;
 }
@@ -194,5 +187,7 @@
 
     if (argc < 2) {
-        std::cout <<"usage: "<< argv[0] <<" <command> <arg-list>"<< std::endl;
+        Tcl_AppendResult(interp, "usage: \"", argv[0],
+            "\": <command> <arg-list>", 
+            (char*)NULL);
         return TCL_ERROR;
     }
@@ -325,5 +320,5 @@
     int argsLeft         = 0;     // temp variable for calculation
     int noerr              = 0;     // err flag for Tcl_GetCommandInfo
-    Tcl_CmdInfo* infoPtr = NULL;  // pointer to the command info
+    Tcl_CmdInfo info;  // pointer to the command info
 
     toPath = std::string(argv[nextarg++]);
@@ -333,9 +328,17 @@
     if (argsLeft == 2) {
         fromObjStr = std::string(argv[nextarg++]);
-        noerr = Tcl_GetCommandInfo(interp, fromObjStr.c_str(), infoPtr);
-        if (noerr && infoPtr) {
-            fromObj = (RpLibrary*) (infoPtr->clientData);
-        }
-        fromObj = NULL; // gotta figure out how to get the actual lib here
+        noerr = Tcl_GetCommandInfo(interp, fromObjStr.c_str(), &info);
+        if (noerr == 1) {
+            if (info.proc == RpLibCallCmd) {
+                fromObj = (RpLibrary*) (info.clientData);
+            }
+            else {
+                Tcl_ResetResult(interp);
+                Tcl_AppendResult(interp,
+                    "wrong arg type: xmlobj should be a Rappture Library\"",
+                    (char*)NULL);
+                return TCL_ERROR;
+            }
+        }
         fromPath = std::string(argv[nextarg++]);
     }
@@ -344,4 +347,5 @@
     }
     else {
+        Tcl_ResetResult(interp);
         Tcl_AppendResult(interp, 
             "wrong # args: should be \"copy path from ?xmlobj? path\"",
@@ -351,4 +355,5 @@
 
     if (from != "from") {
+        Tcl_ResetResult(interp);
         Tcl_AppendResult(interp,
             "bad syntax: should be \"copy path from ?xmlobj? path\"",
@@ -365,4 +370,68 @@
     Tcl_AppendResult(interp, "", (char*)NULL);
 
+    return TCL_OK;
+}
+
+int
+RpTclLibDiff     (   ClientData cdata,
+                    Tcl_Interp *interp,
+                    int argc,
+                    const char *argv[]  )
+{
+
+    Tcl_CmdInfo info;                // pointer to the command info
+    std::string otherLibStr = "";
+    RpLibrary* otherLib     = NULL;
+    int nextarg             = 2;     // start parsing using the '2'th argument
+    int argsLeft            = 0;     // temp variable for calculation
+    int noerr               = 0;     // err flag for Tcl_GetCommandInfo
+
+    std::list<std::string> diffList; // list to store the return value 
+                                     // from diff command
+    std::list<std::string>::iterator diffListIter;
+
+    // parse input arguments
+    argsLeft = (argc-nextarg);
+    if (argsLeft == 1) {
+        otherLibStr = std::string(argv[nextarg++]);
+        noerr = Tcl_GetCommandInfo(interp, otherLibStr.c_str(), &info);
+        if (noerr == 1) {
+            if (info.proc == RpLibCallCmd) {
+                otherLib = (RpLibrary*) (info.clientData);
+            }
+            else {
+                Tcl_ResetResult(interp);
+                Tcl_AppendResult(interp,
+                    "wrong arg type: xmlobj should be a Rappture Library\"",
+                    (char*)NULL);
+                return TCL_ERROR;
+            }
+        }
+    }
+    else {
+        Tcl_ResetResult(interp);
+        Tcl_AppendResult(interp, 
+            "wrong # args: should be \"diff <xmlobj>\"",
+            (char*)NULL);
+        return TCL_ERROR;
+    }
+
+    // perform the diff command
+    diffList = ((RpLibrary*) (cdata))->diff(otherLib,"input");
+    diffListIter = diffList.begin();
+
+    Tcl_ResetResult(interp);
+
+    // parse through the output of the diff command
+    // put it into the return result
+    while (diffListIter != diffList.end()) {
+        Tcl_AppendElement(interp,(*diffListIter).c_str());
+
+        // increment the iterator
+        diffListIter++;
+    }
+
+
+    // Tcl_AppendResult(interp, retStr.c_str(), (char*)NULL);
     return TCL_OK;
 }
@@ -473,10 +542,53 @@
     std::string path = "";
 
-    if (argc > 2) {
+    if (argc == 3) {
         path = std::string(argv[2]);
+    }
+    else if (argc != 2) {
+        Tcl_ResetResult(interp);
+        Tcl_AppendResult(interp, 
+            "wrong # args: should be \"get ?path?\"",
+            "\":", (char*)NULL);
+        return TCL_ERROR;
     }
 
     // call the Rappture Library Get Function
     retStr = ((RpLibrary*) cdata)->getString(path);
+
+    // clear any previous result in the interpreter
+    // store the new result in the interpreter
+    Tcl_ResetResult(interp);
+    Tcl_AppendResult(interp, retStr.c_str(), (char*)NULL);
+
+    return TCL_OK;
+}
+
+int
+RpTclLibIsa     (   ClientData cdata,
+                    Tcl_Interp *interp,
+                    int argc,
+                    const char *argv[]  )
+{
+
+    std::string compVal = ""; // string value of object being compared to
+    std::string retStr  = ""; // return value of rappture get fxn
+
+    if (argc == 3) {
+        compVal = std::string(argv[2]);
+    }
+    else {
+        Tcl_ResetResult(interp);
+        Tcl_AppendResult(interp, 
+            "wrong # args: should be \"get ?path?\"",
+            "\":", (char*)NULL);
+        return TCL_ERROR;
+    }
+
+    if (compVal == RAPPTURE_OBJ_TYPE) {
+        retStr = "1";
+    }
+    else {
+        retStr = "0";
+    }
 
     // clear any previous result in the interpreter
@@ -653,5 +765,5 @@
 {
 
-    std::string path = std::string("");    // path of where to copy data from
+    std::string path = std::string("");    // path of where to remove data from
     int nextarg = 2;
 
@@ -664,5 +776,5 @@
     }
     else {
-        Tcl_AppendResult(interp, 
+        Tcl_AppendResult(interp,
             "wrong # args: should be \"remove ?path?\"",
             (char*)NULL);
Index: /trunk/src/tcl/tcl_test.tcl
===================================================================
--- /trunk/src/tcl/tcl_test.tcl	(revision 223)
+++ /trunk/src/tcl/tcl_test.tcl	(revision 224)
@@ -77,10 +77,36 @@
 
 puts "COPYING BETWEEN LIBS"
-$libObj1 copy "input.test" from libObj2 "input.(max)"
+$libObj1 copy "input.test" from $libObj2 "input.(max)"
 puts [$libObj1 xml]
+
+puts "COPYING BETWEEN LIBS - this should fail"
+set err [$libObj1 copy "input.test" from put "input.(max)"]
+puts $err
 
 #puts [$libObj xml]
 puts "isvalid test1: "
-# puts [Rappture::library isvalid $libObj1]
+puts [Rappture::library isvalid $libObj1]
 puts "isvalid test2: "
-# puts [Rappture::library isvalid library0]
+puts [Rappture::library isvalid library0]
+puts "isvalid test3: "
+puts [Rappture::library isvalid puts]
+puts "testing lib0's xml"
+puts [library0 xml]
+
+puts "TEST ISA"
+puts "$libObj1 isa ::Rappture::LibraryObj : "
+puts [$libObj1 isa ::Rappture::LibraryObj]
+puts "$libObj1 isa ::Rappture::Table : "
+puts [$libObj1 isa ::Rappture::Table]
+#puts "$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj: "
+#puts [$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj]
+
+puts "TEST DIFF"
+puts "changing the value of input.number(min) to 4"
+$libObj1 put input.number(min).current "4"
+$libObj2 put input.number(jdjd).current "4"
+puts "$libObj1 diff $libObj2"
+puts [$libObj1 diff $libObj2]
+#foreach {op vpath oldval newval} [$libObj1 diff $libObj2] {
+#    puts "op
+
Index: /trunk/test/src/RpLibrary_test.cc
===================================================================
--- /trunk/test/src/RpLibrary_test.cc	(revision 223)
+++ /trunk/test/src/RpLibrary_test.cc	(revision 224)
@@ -13,4 +13,5 @@
 
 #include "RpLibrary.h"
+#include <list>
 
 int test_element (RpLibrary* lib, std::string path );
@@ -198,4 +199,51 @@
 }
 
+int test_entities (RpLibrary* lib)
+{
+    std::list<std::string>::iterator iter;
+    std::list<std::string> elist = lib->entities();
+
+    iter = elist.begin();
+
+    std::cout << "TESTING ENTITIES BEGIN" << std::endl;
+    std::cout << "path = "<< lib->nodePath() << std::endl;
+
+    while (iter != elist.end() ) {
+        std::cout << *iter << std::endl;
+        iter++;
+    }
+
+    std::cout << "TESTING ENTITIES END" << std::endl;
+
+    return 0;
+}
+
+int test_diff (RpLibrary* lib1, RpLibrary* lib2)
+{
+    std::list<std::string>::iterator iter;
+    std::list<std::string> elist;
+
+    elist = lib1->diff(lib2,"input");
+
+    iter = elist.begin();
+
+    std::cout << "TESTING DIFF BEGIN" << std::endl;
+
+    int count = 0;
+    while (iter != elist.end() ) {
+        std::cout << *iter << " ";
+        iter++;
+        count++;
+        if (count == 4) {
+            std::cout << std::endl;
+            count = 0;
+        }
+
+    }
+
+    std::cout << "TESTING DIFF END" << std::endl;
+
+    return 0;
+}
 
 /*
@@ -315,4 +363,31 @@
     std::cout << lib->xml() << std::endl;
 
+    RpLibrary* libInput = lib->element("input");
+    test_entities(lib);
+    test_entities(libInput);
+
+    /*
+    std::list<std::string> l1 = lib->value("input.number(min)");
+    std::list<std::string> l2 = lib->value("input.number(max)");
+    std::cout << "l1 = " << l1.front() << " " << l1.back() << std::endl;
+    std::cout << "l2 = " << l2.front() << " " << l2.back() << std::endl;
+    */
+
+    RpLibrary* dlib1 = new RpLibrary(std::string(argv[1]));
+    RpLibrary* dlib2 = new RpLibrary(std::string(argv[1]));
+    test_diff(dlib1,dlib2);
+    std::cout << "dlib1-------------------------------------" << std::endl;
+    std::cout << dlib1->xml() << std::endl;
+    std::cout << "dlib2-------------------------------------" << std::endl;
+    std::cout << dlib1->xml() << std::endl;
+    dlib1 = lib;
+    test_diff(dlib1,dlib2);
+    std::cout << "dlib1-------------------------------------" << std::endl;
+    std::cout << dlib1->xml() << std::endl;
+    std::cout << "dlib2-------------------------------------" << std::endl;
+    std::cout << dlib1->xml() << std::endl;
+
+
+
     // test copy assignment operator
     lib2 = *lib;
@@ -345,4 +420,5 @@
 
     lib2.result();
+
 
     return 0;
