protected final void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
boolean addToTable;
boolean mustToBeAddedToTable;
String value;
if (atts instanceof EncodingAlgorithmAttributes) {
final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
Object data;
String alphabet;
for (int i = 0; i < eAtts.getLength(); i++) {
final String uri = atts.getURI(i);
if (encodeAttribute(uri, atts.getQName(i), atts.getLocalName(i))) {
data = eAtts.getAlgorithmData(i);
// If data is null then there is no algorithm data
if (data == null) {
value = eAtts.getValue(i);
addToTable = isAttributeValueLengthMatchesLimit(value.length());
mustToBeAddedToTable = eAtts.getToIndex(i);
alphabet = eAtts.getAlpababet(i);
if (alphabet == null) {
if (uri == "http://www.w3.org/2001/XMLSchema-instance" ||
uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
value = convertQName(value);
}
encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustToBeAddedToTable);
} else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
encodeDateTimeNonIdentifyingStringOnFirstBit(
value, addToTable, mustToBeAddedToTable);
} else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
encodeNumericNonIdentifyingStringOnFirstBit(
value, addToTable, mustToBeAddedToTable);
} else {
encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustToBeAddedToTable);
}
} else {
encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
eAtts.getAlgorithmIndex(i), data);
}
}
}
} else {
for (int i = 0; i < atts.getLength(); i++) {