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

2006/unicorn/src/org/w3c/unicorn/util XHTMLize.java,1.7,1.8

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 22 Oct 2009 14:59:53 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1N0z8r-0008Kf-Sa@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv31994/src/org/w3c/unicorn/util

Modified Files:
	XHTMLize.java 
Log Message:
XHTMLize is not needed anymore, escaping is done inside the templates only where needed with Escape Velocity Tool

Index: XHTMLize.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/XHTMLize.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- XHTMLize.java	19 Oct 2009 10:09:04 -0000	1.7
+++ XHTMLize.java	22 Oct 2009 14:59:51 -0000	1.8
@@ -1,24 +1,7 @@
 package org.w3c.unicorn.util;
 
-import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.velocity.app.event.ReferenceInsertionEventHandler;
 
-/**
- * Escape all XML Entities in the reference insertion. Specifically, the
- * following conversions are performed:
- * <DL>
- * <DT>&amp;</DT>
- * <DD>&amp;amp;</DD>
- * <DT>&lt;</DT>
- * <DD>&amp;lt;</DD>
- * <DT>&gt;</DT>
- * <DD>&amp;gt;</DD>
- * <DT>&quot;</DT>
- * <DD>&amp;quot;</DD>
- * </DL>
- * 
- * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
- */
 public class XHTMLize implements ReferenceInsertionEventHandler {
 
 	/**
@@ -28,19 +11,6 @@
 		if (oValue == null) {
 			return null;
 		}
-/*		if (oValue instanceof A) {
-			A link = (A) oValue;
-			return insertA(link);
-		}
-		if (oValue instanceof Img) {
-			Img image = (Img) oValue;
-			return insertImg(image);
-		}
-		if (oValue instanceof Code) {
-			Code code = (Code) oValue;
-			return insertCode(code);
-		}*/
-		
 		return oValue.toString();
 		
 		/*if (sReference.startsWith("$ucn.evaluate"))
@@ -51,60 +21,4 @@
 			return StringEscapeUtils.escapeHtml(oValue.toString());*/
 	}
 
-	/**
-	 * Insert a link
-	 * 
-	 * @param aLink
-	 *            link to insert
-	 * @return return the object containing the link
-	 */
-/*	private Object insertA(final A aLink) {
-		String sResultat = "<a href=\""
-			    + StringEscapeUtils.escapeHtml(aLink.getHref()) + "\">";
-		for (final Object oElement : aLink.getContent()) {
-			if (oElement instanceof Img) {
-				sResultat += insertImg((Img) oElement);
-			} else {
-				sResultat += StringEscapeUtils.escapeHtml(oElement.toString());
-			}
-		}
-		sResultat += "</a>";
-		return sResultat;
-	}
-
-	/**
-	 * Insert code tag into the tags
-	 * 
-	 * @param aCode
-	 *            code to insert
-	 * @return object with code inserted
-	 */
-/*	private Object insertCode(final Code aCode) {
-		String sResultat = "<code>";
-		for (final Object oElement : aCode.getContent()) {
-			if (oElement instanceof A) {
-				sResultat += insertA((A) oElement);
-			} else if (oElement instanceof Img) {
-				sResultat += insertImg((Img) oElement);
-			} else {
-				sResultat += StringEscapeUtils.escapeHtml(oElement.toString());
-			}
-		}
-		sResultat += "</code>";
-		return sResultat;
-	}
-
-	/**
-	 * Insert an img tag
-	 * 
-	 * @param img
-	 *            image path to insert
-	 * @return the string containing the image tag
-	 */
-/*	private String insertImg(final Img aImage) {
-		return "<img src=\"" + StringEscapeUtils.escapeHtml(aImage.getSrc())
-				+ "\" alt=\"" + StringEscapeUtils.escapeHtml(aImage.getAlt())
-				+ "\"/>";
-	}*/
-
 }
Received on Thursday, 22 October 2009 14:59:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC