/** * Returns a unique namespace prefix based on the given hint. * We need prefixes to be unique within the current namespace * stack as otherwise for example a previously added attribute * to the current element might incorrectly be using a prefix * that is being redefined in this element. * * @param hint prefix hint * @return unique prefix */ private String getUniquePrefix(String hint) { String prefix = hint; for (int i = 2; prefixExists(prefix); i++) { prefix = hint + i; } return prefix; }
/** * Returns a unique namespace prefix based on the given hint. * We need prefixes to be unique within the current namespace * stack as otherwise for example a previously added attribute * to the current element might incorrectly be using a prefix * that is being redefined in this element. * * @param hint prefix hint * @return unique prefix */ private String getUniquePrefix(String hint) { String prefix = hint; for (int i = 2; prefixExists(prefix); i++) { prefix = hint + i; } return prefix; }
/** * Returns a unique namespace prefix based on the given hint. * We need prefixes to be unique within the current namespace * stack as otherwise for example a previously added attribute * to the current element might incorrectly be using a prefix * that is being redefined in this element. * * @param hint prefix hint * @return unique prefix */ private String getUniquePrefix(String hint) { String prefix = hint; for (int i = 2; prefixExists(prefix); i++) { prefix = hint + i; } return prefix; }