Determine is value is legal NMToken type
/*
com.sun.enterprise.util.LocalStringManagerImpl smh =
StringManagerHelper.getLocalStringsManager();
*/
String XMLdoc = XMLtop + value + XMLbottom;
logger.log(Level.FINE,
"com.sun.enterprise.tools.verifier.NameToken.print", // NOI18N
new Object[]{XMLdoc});
try {
InputSource source = new InputSource(
new ByteArrayInputStream(XMLdoc.getBytes()));
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(true);
// ValidatingParser p = new ValidatingParser();
XMLReader p = spf.newSAXParser().getXMLReader();
// XMLErrorHandler eh = new XMLErrorHandler(null);
p.setErrorHandler(new XMLValidationHandler());
p.parse(source);
return true;
} catch (Exception e) {
return false;
}