public static boolean isXMLNameStart ( int codepoint ) { if ( codepoint >= Character . codePointAt ( "A" , 0 ) && codepoint <= Character . codePointAt ( "Z" , 0 ) ) { return true ; } else if ( codepoint == Character . codePointAt ( "_" , 0 ) ) { return true ; } else if ( codepoint >= Character . codePointAt ( "a" , 0 ) && codepoint <= Character . codePointAt ( "z" , 0 ) ) { return true ; } else if ( codepoint >= 0xC0 && codepoint <= 0xD6 ) { return true ; } else if ( codepoint >= 0xD8 && codepoint <= 0xF6 ) { return true ; } else if ( codepoint >= 0xF8 && codepoint <= 0x2FF ) { return true ; } else if ( codepoint >= 0x370 && codepoint <= 0x37D ) { return true ; } else if ( codepoint >= 0x37F && codepoint <= 0x1FFF ) { return true ; } else if ( codepoint >= 0x200C && codepoint <= 0x200D ) { return true ; } else if ( codepoint >= 0x2070 && codepoint <= 0x218F ) { return true ; } else if ( codepoint >= 0x2C00 && codepoint <= 0x2FEF ) { return true ; } else if ( codepoint >= 0x3001 && codepoint <= 0xD7FF ) { return true ; } else if ( codepoint >= 0xF900 && codepoint <= 0xFDCF ) { return true ; } else if ( codepoint >= 0xFDF0 && codepoint <= 0xFFFD ) { return true ; } else if ( codepoint >= 0x10000 && codepoint <= 0xEFFFF ) { return true ; } else { return false ; } }
Determine if the given character is a legal starting character for an XML name . Note that although a colon is a legal value its use is strongly discouraged and this method will return false for a colon .