But you don't need to ask that question here. There is API documentation which tells you what the meaning of every single method in every single class is. Just go and read it.
I don't even need to provide a link, because the links are already automatically there in your post. Look at your original post and you'll see that the class names are actually links. Follow them.
Of course if you have questions about what you read there, don't hesitate to ask. But asking us to explain something for which the official explanation is readily available, that's just a waste of your time and ours.
Joined: Dec 20, 2007
Thanks Paul. But i dont think there would be anyone who would be here in this forum without knowing how to find what a method does. Ofcourse, i can google the method name and find it out what it does. But what i wanted to knw was how element, node and node list differs.
Basic idea of providing the xml in my first post was to know how does node, element and node list differs. May be i was not categorical enough
Element i understand, for eg say <Title> tag in above eg.
Now say i do call a getDocumentElement() on the document object, hope i guess reference to the rootElement i.e <Library.>
Now, say with this root element, i do a getChildNodes(), then i guess i should get 2 nodes, i.e Book as there are two occurences of <book>
Now , i do
Node node=nodes.item(0), then i would get reference to the first "Book" Node. Now i want to read the element values like Title,
Author, etc , for which i would call getElementsByTagName with "tags" as parameters...
I dont know whether my understandinng is correct...Please verify.. Thanks for patience
Yes, that sort of looks like an accurate description of what code like that might do if you ran it. But the question "What will happen when I run this code" is also one which there is no point in asking on a forum. It's much more straightforward to just run the code and see what happens.