public void writeEncodedAttribute(String attribute) {
		int length = attribute.length();

		for (int i = 0; i < length; i++) {
			char ch = attribute.charAt(i);

			if (ch == '<') {
				print(LESS_THAN_ENTITY);
			} else if (ch == '>') {
				print(GREATER_THAN_ENTITY);
			} else if (ch == '&') {
				print(AMPERSAND_ENTITY);
			} else if (ch == '"') {
				print("&quot;"); //$NON-NLS-1$
			} else if (ch == '\'') {
				print("&apos;"); //$NON-NLS-1$
			} else if (ch >= ' ' && ch <= '~') {
				print(ch);
			} else {
				print(ENTITY_CODE_PREFIX);
				print((int) ch);
				print(';');
			}
		}
	}