This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
<Department> <Name>Chemistry</Name> <Address>1 Main Campus Rd</Address> <Phone>1-800-200-3909</Phone> ... ... </Department>
What I need is to get the String content for "Name", "Address", "Phone", etc. One way is to **** // get "Department" element first, let's assume it is done and passed as "departmentElement" then XpathAPI.selectSingleNode(departmentElement, "./Name"); XpathAPI.selectSingleNode(departmentElement, "./Phone"); ... .. **** The problem is I have to do Xpath for many times if I have *many* sub elements.
Is there a way I can get all the sub elements at one (use XpathAPI once), and then get string values for "Name", "Address" easily ?