public static int name2type(String nm) {
entityTypes.put("PUBLIC", Integer.valueOf(PUBLIC));
entityTypes.put("CDATA", Integer.valueOf(CDATA));
entityTypes.put("SDATA", Integer.valueOf(SDATA));
entityTypes.put("PI", Integer.valueOf(PI));
entityTypes.put("STARTTAG", Integer.valueOf(STARTTAG));
entityTypes.put("ENDTAG", Integer.valueOf(ENDTAG));
entityTypes.put("MS", Integer.valueOf(MS));
entityTypes.put("MD", Integer.valueOf(MD));
entityTypes.put("SYSTEM", Integer.valueOf(SYSTEM));
Integer i = (Integer)entityTypes.get(nm);
return (i == null) ? CDATA : i.intValue();
}
Converts nm string to the corresponding
entity type. If the string does not have a corresponding
entity type, returns the type corresponding to "CDATA".
Valid entity types are: "PUBLIC", "CDATA", "SDATA", "PI",
"STARTTAG", "ENDTAG", "MS", "MD", "SYSTEM". |