W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2009

2006/unicorn/src/org/w3c/unicorn/util EscapeHTMLEntities.java,NONE,1.1

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 14 Sep 2009 15:49:53 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MnDoP-00080M-CV@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv30756/src/org/w3c/unicorn/util

Added Files:
	EscapeHTMLEntities.java 
Log Message:
new class EscapeHTMLEntities to use instead of EscapeXMLEntities to avoid displaying &apos; on ie (&apos; is an xml but not an html entity) 

--- NEW FILE: EscapeHTMLEntities.java ---
package org.w3c.unicorn.util;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.velocity.app.event.ReferenceInsertionEventHandler;

public class EscapeHTMLEntities implements ReferenceInsertionEventHandler {

	/**
	 * Escape the XML entities for all inserted references.
	 */
	public Object referenceInsert(final String sUnused, final Object oValue) {
		final String sValue = oValue.toString();
		return StringEscapeUtils.escapeHtml(sValue);
	}
	
}
Received on Monday, 14 September 2009 15:50:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:14 GMT