Hi I am making a DOM tree, which will be supported by multiple
JSP documents. Thus allowing an xml file to be made.
I am aware of how to set up the attribute, as the following example demonstrates:
//Create an element for member
//Place the <member> element underneath the <members> element in the tree
Element memberElement = document.createElement("member");
memberElement.setAttribute("id", idNum);
rootElement.appendChild(memberElement);
How ever, if we have an <address> element and we want to have "types" : "home" "work" and "postal" how can we do that?
I think it can be done the following way:
Element addressElement = document.createElement("address");
memberElement.setType("home", "work", "postal" );
memberElement.appendChild(addressElement);
please tell me if my "setType" is correct or not. Ive researched fair bit but im unable to find a solution. If its incorrect what shud be done to set "types" of an element.
Thanks,
S Ali