dom4j Example:Element e;
e.remove(e.attribute(attributeName));api:Element.remove
public boolean remove(Attribute attribute)
Element.attribute
public Attribute attribute(String name)
e.remove(e.attribute(attributeName));api:Element.remove
public boolean remove(Attribute attribute)
Element.attribute
public Attribute attribute(String name)
//http://www-900.ibm.com/developerWorks/cn/cnonlinetutorial.nsf/gethtml?OpenAgent&url=/developerWorks/cn/education/xml/x-udom/tutorial/index.html /*
应用程序还可以删除属性 。例如 ,在输出中显示客户信用限额信息也许是不可取的 ,因此应用程序可以临时地将该属性从文档中删除 。
删除信息是相当简单的 ,只需使用 removeAttribute()来删除数据 。
*/
private static void deleteAttribute(Element root)
{
/*
Element thisOrder = (Element)orders.item(orderNum);
Element customer = (Element)thisOrder.getElementsByTagName("customerid").item(0);
customer.removeAttribute("limit");
NodeList orderItems = thisOrder.getElementsByTagName("item");
*/
}