- && (((ModuleIdentifier) o).getRevision() == SimpleDateFormatUtil.DEFAULT_DATE_IMP ||
- ((ModuleIdentifier) o).getRevision() == SimpleDateFormatUtil.DEFAULT_BELONGS_TO_DATE);
+ && (((ModuleIdentifier) o).getRevision() == SimpleDateFormatUtil.DEFAULT_DATE_IMP || ((ModuleIdentifier) o)
+ .getRevision() == SimpleDateFormatUtil.DEFAULT_BELONGS_TO_DATE);
+ }
+
+ /**
+ * Replaces illegal characters of QName by the name of the character (e.g.
+ * '?' is replaced by "QuestionMark" etc.).
+ *
+ * @param string
+ * input String
+ * @return result String
+ */
+ public static String replaceIllegalCharsForQName(String string) {
+ string = LEFT_PARENTHESIS_MATCHER.replaceFrom(string, "LeftParenthesis");
+ string = RIGHT_PARENTHESIS_MATCHER.replaceFrom(string, "RightParenthesis");
+ string = AMPERSAND_MATCHER.replaceFrom(string, "Ampersand");
+ string = QUESTION_MARK_MATCHER.replaceFrom(string, "QuestionMark");
+
+ return string;