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

Function xmlValidateNmtokensValueInternal

ThirdParty/libxml2/vtklibxml2/valid.c:3507–3553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3505 */
3506
3507static int
3508xmlValidateNmtokensValueInternal(xmlDocPtr doc, const xmlChar *value) {
3509 const xmlChar *cur;
3510 int val, len;
3511
3512 if (value == NULL) return(0);
3513 cur = value;
3514 val = xmlStringCurrentChar(NULL, cur, &len);
3515 cur += len;
3516
3517 while (IS_BLANK(val)) {
3518 val = xmlStringCurrentChar(NULL, cur, &len);
3519 cur += len;
3520 }
3521
3522 if (!xmlIsDocNameChar(doc, val))
3523 return(0);
3524
3525 while (xmlIsDocNameChar(doc, val)) {
3526 val = xmlStringCurrentChar(NULL, cur, &len);
3527 cur += len;
3528 }
3529
3530 /* Should not test IS_BLANK(val) here -- see erratum E20*/
3531 while (val == 0x20) {
3532 while (val == 0x20) {
3533 val = xmlStringCurrentChar(NULL, cur, &len);
3534 cur += len;
3535 }
3536 if (val == 0) return(1);
3537
3538 if (!xmlIsDocNameChar(doc, val))
3539 return(0);
3540
3541 val = xmlStringCurrentChar(NULL, cur, &len);
3542 cur += len;
3543
3544 while (xmlIsDocNameChar(doc, val)) {
3545 val = xmlStringCurrentChar(NULL, cur, &len);
3546 cur += len;
3547 }
3548 }
3549
3550 if (val != 0) return(0);
3551
3552 return(1);
3553}
3554
3555/**
3556 * xmlValidateNmtokensValue:

Callers 2

xmlValidateNmtokensValueFunction · 0.85

Calls 2

xmlStringCurrentCharFunction · 0.85
xmlIsDocNameCharFunction · 0.85

Tested by

no test coverage detected