/** Writes out an entity declaration for this entity */ public void write(PrintWriter out) throws IOException { out.print("<!ENTITY "); if (isParsed) { out.print(" % "); } out.print(name); if (value != null) { char quoteChar = '"'; if (value.indexOf(quoteChar) >= 0) quoteChar = '\''; out.print(quoteChar); out.print(value); out.print(quoteChar); } else { externalID.write(out); if (ndata != null) { out.print(" NDATA "); out.print(ndata); } } out.println(">"); }