[jboss-user] [JBoss Seam] - Re: s:formattedText breaking, and seamspace
saeediqbal1
do-not-reply at jboss.com
Tue Sep 11 19:08:27 EDT 2007
I am thinking of putting this method to save the day. Would you guys let me know what would be the best place to put it in ?
public static String stripNonValidXMLCharacters(String in) {
| StringBuffer out = new StringBuffer(); // Used to hold the output.
| char current; // Used to reference the current character.
|
| if (in == null || ("".equals(in))) return ""; // vacancy test.
| for (int i = 0; i < in.length(); i++) {
| current = in.charAt(i); // NOTE: No IndexOutOfBoundsException caught here; it should not happen.
| if ((current == 0x9) ||
| (current == 0xA) ||
| (current == 0xD) ||
| ((current >= 0x20) && (current <= 0xD7FF)) ||
| ((current >= 0xE000) && (current <= 0xFFFD)) ||
| ((current >= 0x10000) && (current <= 0x10FFFF)))
| out.append(current);
| }
| return out.toString();
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083210#4083210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083210
More information about the jboss-user
mailing list