List of usage examples for org.dom4j Attribute setData
void setData(Object data);
From source file:org.orbeon.oxf.xforms.InstanceData.java
License:Open Source License
private static InstanceData createNewInstanceData(Node node) { final InstanceData instanceData; if (node instanceof Element) { final Element element = (Element) node; instanceData = InstanceData.createNewInstanceData(element.getData()); element.setData(instanceData);//ww w . j av a 2 s . c o m } else if (node instanceof Attribute) { final Attribute attribute = (Attribute) node; instanceData = InstanceData.createNewInstanceData(attribute.getData()); attribute.setData(instanceData); } else if (node instanceof Document) { // We can't store data on the Document object. Use root element instead. final Element element = ((Document) node).getRootElement(); instanceData = InstanceData.createNewInstanceData(element.getData()); element.setData(instanceData); } else { // No other node type is supported throw new OXFException("Cannot create InstanceData on node type: " + node.getNodeTypeName()); } return instanceData; }