Ejemplo n.º 1
0
 private static final void writeAttr(Writer out, String name, String value) throws IOException {
   out.write(' ');
   out.write(name);
   out.write("=\"");
   out.write(XMLs.encodeAttribute(value));
   out.write('"');
 }
Ejemplo n.º 2
0
 /** Appends an attribute to the string buffer, if <code>attrValue</code> is not null. */
 protected static final void append(StringBuffer sb, String attrName, String attrValue) {
   if (attrValue != null)
     sb.append(' ')
         .append(attrName)
         .append("=\"")
         .append(XMLs.encodeAttribute(attrValue))
         .append('"');
   // it might contain " or other special characters
 }