// the character to be substituted, as a Unicode codepoint (may be > 65535)
private String replacementString = null;
public void prepareAttributes() throws XPathException {
AttributeCollection atts = getAttributeList();
for (int a=0; a<atts.getLength(); a++) {
int nc = atts.getNameCode(a);
String f = getNamePool().getClarkName(nc);
if (f==StandardNames.CHARACTER) {
String s = atts.getValue(a);
switch (s.length()) {
case 0:
compileError("character attribute must not be zero-length", "XTSE0020");
codepoint = 256; // for error recovery
break;
case 1:
codepoint = s.charAt(0);
break;
case 2:
if (UTF16.isHighSurrogate(s.charAt(0)) &&
UTF16.isLowSurrogate(s.charAt(1))) {
codepoint = UTF16.combinePair(s.charAt(0), s.charAt(1));
} else {
compileError("character attribute must be a single XML character", "XTSE0020");
codepoint = 256; // for error recovery
}
break;
default:
compileError("character attribute must be a single XML character", "XTSE0020");
codepoint = 256; // for error recovery
}
} else if (f==StandardNames.STRING) {
replacementString = atts.getValue(a);
} else {
checkUnknownAttribute(nc);
}
}
if (codepoint==-1) {