15:10:07 #startmeeting jQuery/XPath for MD-SAL intern 15:10:07 Meeting started Tue Jul 1 15:10:07 2014 UTC. The chair is colindixon. Information about MeetBot at http://ci.openstack.org/meetbot.html. 15:10:07 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 15:10:07 The meeting name has been set to 'jquery_xpath_for_md_sal_intern' 15:10:08 updated my git with latest code 15:10:27 #link https://github.com/neel1438/Opendaylight/ Neel_B has updated the github with his latest code 15:10:37 hopefully this meeting will be fast and easy 15:10:40 so, what did you find? 15:11:39 it is not exactly forming a tree 15:12:08 if i try nodeList nodelist=(NodeList)xpath.evaluate("/",root,XPathConstants.NODESET); 15:12:20 only root node is listed 15:12:44 if i try any thing other like "//b" or "//b/c1" 15:12:52 it shows 0 nodes 15:13:39 * colindixon looks 15:13:53 Looking.. 15:14:42 Neel - one thing that would be good is to have a side-by-side comparison. That is, we really want to write a "unit test" which tells us exactly how we expect to work. Then swap out the implementation and make sure that it still works 15:15:09 The way I would do this is take XML mark up that represents the tree structure we think we are returning, and then make a series of calls and validate the output. 15:15:26 Then swap out the implementation like we did in your test program and make sure we handle all of the same cases in the same way. 15:15:49 That will help us. Because at this point I can't figure out if this is expected behavior or not. Which means we probably need to map that out a little bit more. 15:17:17 okay 15:17:22 thats what i was thinking 15:17:27 #info it seems as thoguh the sample code for the new node is behaving oddly, but it’s hard to tell if it’s right or not 15:17:57 #info the next step woudl be to build a unit test (or a few) which make parallel calls to a real Document and to a Node that we think should behave the same 15:18:15 hey jmedved 15:18:44 jmedved: if you wanted to catch up, the log so far is here: https://meetings.opendaylight.org/opendaylight-intern/2014/jquery_xpath_for_md_sal_intern/opendaylight-intern-jquery_xpath_for_md_sal_intern.2014-07-01-15.10.log.txt 15:18:52 Neel_B: does that make sense? 15:18:59 yeah 15:20:15 devinavery: do you have 2-3 queries that you think would be good ones? 15:20:34 otherwise, I can take a look 15:21:30 we are thinking of this right a-->b-->c1 15:21:30 | 15:21:36 b-->c2 15:21:37 Um. We can start simple. 15:21:53 this is the tree structure i am thinking 15:21:54 /a 15:21:57 /a/b 15:22:02 /a/b/c1 15:22:17 I think '/' technically returns the "document" which is why that might be returning null... not positive though 15:22:18 /a/b/c2 15:22:35 no "/" is returning a 15:22:40 nothing else 15:22:55 Neel_B: let me look for a second 15:23:19 Sorry, '/' returns "that" element.. which since we are passing in root (i.e. a) returns a. If you pass in an XML document it would return the XML document 15:23:32 So actually the / should only return 'a' 15:23:39 but /* should return b 15:24:15 okay let me see 15:25:03 "/*" is returning nothing 15:25:36 Ok. Something is fishy there. It would be worth validating my assumptions against a real XML document, but I am 90% sure it should return all immediate children (in this case, b)( 15:26:41 so, Neel_B the next step is to do what we said above 15:27:11 which is come up with 3 queries “/“ and “/*” are good ones probably 15:27:18 Neel_B: do you know how to use Eclipse’s debugger? 15:27:25 or how are you writing the code? 15:27:37 not exactly should not be a problem 15:27:39 though 15:28:02 i guess 15:28:30 using eclipse i put print statements whre ever required 15:28:35 to check 15:29:04 so, do you know how to set breakpoints? 15:29:24 that’s worth looking at 15:29:29 here, hold on one second 15:29:30 okay i would 15:29:56 i used gdb so i know how to use a debugger 15:30:13 but never used eclipse debugger 15:30:48 let’s try this 15:30:54 can you go to http://hangout.vyatta.com/ 15:31:03 and I’ll show you how to use the Eclipse debugger a bit 15:32:20 #action Neel_B to create unit tests where he compares the result of XPath queries to his Node implementations to a Document which we believe should be the same 15:41:25 #info colindixon showed Neel_B a bit of how to use the Eclipse interactive debugger (which will hopefully help a bit) and talked about next steps a bit 15:41:58 Neel_B: do you have the original XML document 15:42:04 I just want to check one thing? 15:42:26 all the nodes ?? 15:42:39 Neel_B: no, the actual a.xml file 15:42:43 so I can look at it 15:42:48 I guess devinavery mailed it out 15:42:50 so I can look there 15:43:25 #info the 3 test queries that seem to make sense to start with for unit tests are “/“, “/*” and “//a/b/c1”, but Neel_B should use his judgement if those queries either don’t work or he thinks there are more tests that make sense 15:43:58 http://pastebin.com/LKTKrsyL 15:44:03 this is a.xml 15:44:09 thanks 15:44:17 oh, no, not that one 15:44:26 the a/b/{c1,c2} 15:44:35 no i don't have that one 15:44:41 i could write in a bit 15:45:40 15:45:41 15:45:43 Some Value 15:45:44 Some Other Value 15:45:45 15:45:46 15:45:47 that one 15:45:50 15:45:51 15:45:51 Some Value 15:45:51 Some Other Value 15:45:51 15:45:51 15:45:54 yes 15:45:55 that’ 15:46:06 we do not need attributes so removed it 15:47:18 exactly 15:47:52 okay sure 15:47:57 (need to drop off to get ready for MD-SAL call. 15:47:58 so, in the unit tests you’d do “Document d = new Document( file.xml )” where file.xml is that document 15:48:02 devinavery: no worries 15:48:05 I’ve got it 15:48:16 yeah 15:48:20 i got it 15:48:25 (I’m actually not sure you can do new Document like that, but you have the general idea 15:48:29 perfect 15:48:40 so, yeah, we’ll plan to meet tomorrow at this time and check in 15:48:54 if this is easy, which I’m hoping it is, you can start with the Ping example we’ve talked about in the past 15:49:10 DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); 15:49:10 Document document = dBuilder.parse(xmlfile); 15:49:13 and as always e-mail if you need anything or just want to let us know how things are doing 15:49:14 this does that 15:49:18 Neel_B: perfect 15:49:25 see, you know more than me already :p 15:49:28 ok 15:49:34 hahaha 15:49:36 anything else you need from us? 15:49:47 after i finish this 15:49:57 i might need help in the ping example 15:50:03 i would email you then 15:50:08 sounds good 15:50:13 please do 15:50:39 e-mail devinavery, me, ryan, and jan just so that everyone is in the loop 15:50:46 thanks again for your time and have a nice night 15:50:49 sleep some :p 15:50:50 yeah i meant all 15:50:59 i will 15:51:04 #endmeeting