Example usage for org.dom4j Node setName

List of usage examples for org.dom4j Node setName

Introduction

In this page you can find the example usage for org.dom4j Node setName.

Prototype

void setName(String name);

Source Link

Document

Sets the text data of this node or this method will throw an UnsupportedOperationException if it is read-only.

Usage

From source file:edu.ucsd.library.xdre.imports.RDFDAMS4ImportHandler.java

/**
 * Update record for resource linking/*w  w w  . j a  va2 s  .co m*/
 * @param url
 * @param node
 */
public void toResourceLinking(String url, Node record) {
    Element pNode = record.getParent();
    if (pNode.getName().endsWith("List")
            && !record.getName().toLowerCase().endsWith(pNode.getName().toLowerCase())) {
        //List elements
        record.setName("rdf:Description");
        ((Element) record).clearContent();
        ((Element) record).selectSingleNode("@rdf:about").setText(toDamsUrl(url));
    } else {
        pNode.addAttribute("rdf:resource", toDamsUrl(url));
        record.detach();
    }
}