dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java
protected void
    printXMLAttribute(String name, String value, int flags)
            throws DapException
    {
        if(name == null) return;
        if((flags & NONNIL) == 0
                && (value == null || value.length() == 0))
            return;
        if((flags & PERLINE) != 0) {
            printer.eol();
            printer.margin();
        }
        printer.print(" " + name + "=");
        printer.print("\"");

        if(value != null) {
            // add xml entity escaping
            if((flags & XMLESCAPED) == 0)
                value = Escape.entityEscape(value, "\"");
            printer.print(value);
        }
        printer.print("\"");
    }
protected void
    printXMLAttribute(String name, String value, int flags)
            throws DapException
    {
        if(name == null) return;
        if((flags & NONNIL) == 0
                && (value == null || value.length() == 0))
            return;
        if((flags & PERLINE) != 0) {
            printer.eol();
            printer.margin();
        }
        printer.print(" " + name + "=");
        printer.print("\"");

        if(value != null) {
            // add xml entity escaping
            if((flags & XMLESCAPED) == 0)
                value = Escape.entityEscape(value, "\"");
            printer.print(value);
        }
        printer.print("\"");
    }
PrintXMLAttributes helper function

@param name
@param value
@param flags
@throws DapException