Example usage for org.dom4j.dtd InternalEntityDecl getName

List of usage examples for org.dom4j.dtd InternalEntityDecl getName

Introduction

In this page you can find the example usage for org.dom4j.dtd InternalEntityDecl getName.

Prototype

public String getName() 

Source Link

Document

Getter for property name.

Usage

From source file:com.cladonia.xml.XDocumentType.java

License:Open Source License

private void write(Writer writer, InternalEntityDecl decl) throws IOException {
    String name = decl.getName();
    String value = decl.getValue();

    if (name.startsWith("%")) {
        name = "% " + name.substring(1);
    }/*  w  w  w  .j a  va 2 s .c o  m*/

    StringBuffer buffer = new StringBuffer("<!ENTITY ");
    buffer.append(name);
    buffer.append(" \"");
    buffer.append(value);
    buffer.append("\">");

    writer.write(buffer.toString());
}