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

Function xmlIsDocNameChar

ThirdParty/libxml2/vtklibxml2/valid.c:3288–3324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3286}
3287
3288static int
3289xmlIsDocNameChar(xmlDocPtr doc, int c) {
3290 if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
3291 /*
3292 * Use the new checks of production [4] [4a] amd [5] of the
3293 * Update 5 of XML-1.0
3294 */
3295 if (((c >= 'a') && (c <= 'z')) ||
3296 ((c >= 'A') && (c <= 'Z')) ||
3297 ((c >= '0') && (c <= '9')) || /* !start */
3298 (c == '_') || (c == ':') ||
3299 (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
3300 ((c >= 0xC0) && (c <= 0xD6)) ||
3301 ((c >= 0xD8) && (c <= 0xF6)) ||
3302 ((c >= 0xF8) && (c <= 0x2FF)) ||
3303 ((c >= 0x300) && (c <= 0x36F)) || /* !start */
3304 ((c >= 0x370) && (c <= 0x37D)) ||
3305 ((c >= 0x37F) && (c <= 0x1FFF)) ||
3306 ((c >= 0x200C) && (c <= 0x200D)) ||
3307 ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
3308 ((c >= 0x2070) && (c <= 0x218F)) ||
3309 ((c >= 0x2C00) && (c <= 0x2FEF)) ||
3310 ((c >= 0x3001) && (c <= 0xD7FF)) ||
3311 ((c >= 0xF900) && (c <= 0xFDCF)) ||
3312 ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
3313 ((c >= 0x10000) && (c <= 0xEFFFF)))
3314 return(1);
3315 } else {
3316 if ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
3317 (c == '.') || (c == '-') ||
3318 (c == '_') || (c == ':') ||
3319 (IS_COMBINING(c)) ||
3320 (IS_EXTENDER(c)))
3321 return(1);
3322 }
3323 return(0);
3324}
3325
3326/**
3327 * xmlValidateNameValue:

Calls

no outgoing calls

Tested by

no test coverage detected