Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.StringTokenizer; public class Main { /** * remove from a name any characters not allowed in XML tags * (what are they?) * @param name * @return */ public static String legalTagName(String name) { String tagName = ""; StringTokenizer st = new StringTokenizer(name, " ,/;'\\"); while (st.hasMoreTokens()) tagName = tagName + st.nextToken(); return tagName; } }