private static int scanNCName()

in src/main/java/org/apache/maven/xinclude/stax/XPointerParser.java [506:538]


        private static int scanNCName(String data, int endOffset, int currentOffset) {
            int ch = data.charAt(currentOffset);
            if (ch >= 0x80) {
                if (!NCName.is11NameStartChar(ch, true)) {
                    return currentOffset;
                }
            } else {
                byte chartype = ASCII_CHAR_MAP[ch];
                if (chartype != CHARTYPE_LETTER && chartype != CHARTYPE_UNDERSCORE) {
                    return currentOffset;
                }
            }

            // while (currentOffset++ < endOffset) {
            while (++currentOffset < endOffset) {
                ch = data.charAt(currentOffset);
                if (ch >= 0x80) {
                    if (!NCName.is11NameChar(ch, true)) {
                        break;
                    }
                } else {
                    byte chartype = ASCII_CHAR_MAP[ch];
                    if (chartype != CHARTYPE_LETTER
                            && chartype != CHARTYPE_DIGIT
                            && chartype != CHARTYPE_PERIOD
                            && chartype != CHARTYPE_MINUS
                            && chartype != CHARTYPE_UNDERSCORE) {
                        break;
                    }
                }
            }
            return currentOffset;
        }