Java tutorial
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You should have received a copy of the license along with this library. * You may also obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0. */ package sf.wicklet.gwt.client.dsl.html; import com.google.gwt.safehtml.shared.SafeHtmlUtils; public class XmlUtil { public static String quoteAttr(final String text) { return "\"" + SafeHtmlUtils.htmlEscape(text) + "\""; } public static String escAttr(final CharSequence s) { return s == null ? "" : SafeHtmlUtils.htmlEscape(s.toString()); } public static String escText(final CharSequence s) { return s == null ? "" : SafeHtmlUtils.htmlEscape(s.toString()); } }