MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlIsNameStartChar

Function xmlIsNameStartChar

ThirdParty/libxml2/vtklibxml2/parser.c:3173–3202  ·  view source on GitHub ↗

* The two following functions are related to the change of accepted * characters for Name and NmToken in the Revision 5 of XML-1.0 * They correspond to the modified production [4] and the new production [4a] * changes in that revision. Also note that the macros used for the * productions Letter, Digit, CombiningChar and Extender are not needed * anymore. * We still keep compatibility to pre-

Source from the content-addressed store, hash-verified

3171 * new XML_PARSE_OLD10 option is given to the parser.
3172 */
3173static int
3174xmlIsNameStartChar(xmlParserCtxtPtr ctxt, int c) {
3175 if ((ctxt->options & XML_PARSE_OLD10) == 0) {
3176 /*
3177 * Use the new checks of production [4] [4a] amd [5] of the
3178 * Update 5 of XML-1.0
3179 */
3180 if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
3181 (((c >= 'a') && (c <= 'z')) ||
3182 ((c >= 'A') && (c <= 'Z')) ||
3183 (c == '_') || (c == ':') ||
3184 ((c >= 0xC0) && (c <= 0xD6)) ||
3185 ((c >= 0xD8) && (c <= 0xF6)) ||
3186 ((c >= 0xF8) && (c <= 0x2FF)) ||
3187 ((c >= 0x370) && (c <= 0x37D)) ||
3188 ((c >= 0x37F) && (c <= 0x1FFF)) ||
3189 ((c >= 0x200C) && (c <= 0x200D)) ||
3190 ((c >= 0x2070) && (c <= 0x218F)) ||
3191 ((c >= 0x2C00) && (c <= 0x2FEF)) ||
3192 ((c >= 0x3001) && (c <= 0xD7FF)) ||
3193 ((c >= 0xF900) && (c <= 0xFDCF)) ||
3194 ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
3195 ((c >= 0x10000) && (c <= 0xEFFFF))))
3196 return(1);
3197 } else {
3198 if (IS_LETTER(c) || (c == '_') || (c == ':'))
3199 return(1);
3200 }
3201 return(0);
3202}
3203
3204static int
3205xmlIsNameChar(xmlParserCtxtPtr ctxt, int c) {

Callers 2

xmlParseNCNameComplexFunction · 0.85
xmlParseStringNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected