public Element(String name, String uri) {
// The shadowing is important here.
// I don't want to set the prefix field just yet.
String prefix = "";
String localName = name;
int colon = name.indexOf(':');
if (colon > 0) {
prefix = name.substring(0, colon);
localName = name.substring(colon + 1);
}
// The order of these next two calls
// matters a great deal.
_setNamespacePrefix(prefix);
_setNamespaceURI(uri);
try {
_setLocalName(localName);
}
catch (IllegalNameException ex) {
ex.setData(name);
throw ex;
}
}
java 语言