Example usage for org.apache.wicket.util.string StringEscapeUtils escapeXml

List of usage examples for org.apache.wicket.util.string StringEscapeUtils escapeXml

Introduction

In this page you can find the example usage for org.apache.wicket.util.string StringEscapeUtils escapeXml.

Prototype

public static void escapeXml(Writer writer, String str) throws IOException 

Source Link

Document

Escapes the characters in a String using XML entities.

Usage

From source file:sf.wicklet.wicketext.util.XmlUtil.java

License:Apache License

@Override
public CharSequence quoteAttr(final String value) {
    final StringPrintWriter buf = new StringPrintWriter(value.length() * 2);
    buf.append('"');
    try {/*from  ww w  . j av  a2 s . com*/
        StringEscapeUtils.escapeXml(buf, value);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
    buf.append('"');
    return buf.toString();
}