I have an xml similar to this
I want to parse this and store to Strings Like VendorId, AuthApplId etc. I got ApplicationID parsed with getElementsByTagName("ApplicationID") if it was then I can use getAttribute("value") method. but in the above mentioned situation what should I do?
解决方案
NodeList applicationIDNodes = getElementsByTagName("ApplicationID");
for (int i = 0; i < applicationIDNodes.length; i++) {
Node applicationIDNode = applciationIdNodes.getItem(i);
NodeList applicationIdChildren = applicationIdNode.getChildren();
String vendorId = applicationIdChildren.getItem(0).getAttribute("value").value();
String authAppliId = applicationIdChildren.getItem(1).getAttribute("value").value();
String actApplID = applicationIdChildren.getItem(2).getAttribute("value").value();
// do whathever you want with vendorId, authAppliId, actApplID
}