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

Function xmlValidateAttributeCallback

ThirdParty/libxml2/vtklibxml2/valid.c:6537–6622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6535}
6536
6537static void
6538xmlValidateAttributeCallback(void *payload, void *data,
6539 const xmlChar *name ATTRIBUTE_UNUSED) {
6540 xmlAttributePtr cur = (xmlAttributePtr) payload;
6541 xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
6542 int ret;
6543 xmlDocPtr doc;
6544 xmlElementPtr elem = NULL;
6545
6546 if (cur == NULL)
6547 return;
6548 switch (cur->atype) {
6549 case XML_ATTRIBUTE_CDATA:
6550 case XML_ATTRIBUTE_ID:
6551 case XML_ATTRIBUTE_IDREF :
6552 case XML_ATTRIBUTE_IDREFS:
6553 case XML_ATTRIBUTE_NMTOKEN:
6554 case XML_ATTRIBUTE_NMTOKENS:
6555 case XML_ATTRIBUTE_ENUMERATION:
6556 break;
6557 case XML_ATTRIBUTE_ENTITY:
6558 case XML_ATTRIBUTE_ENTITIES:
6559 case XML_ATTRIBUTE_NOTATION:
6560 if (cur->defaultValue != NULL) {
6561
6562 ret = xmlValidateAttributeValue2(ctxt, ctxt->doc, cur->name,
6563 cur->atype, cur->defaultValue);
6564 if ((ret == 0) && (ctxt->valid == 1))
6565 ctxt->valid = 0;
6566 }
6567 if (cur->tree != NULL) {
6568 xmlEnumerationPtr tree = cur->tree;
6569 while (tree != NULL) {
6570 ret = xmlValidateAttributeValue2(ctxt, ctxt->doc,
6571 cur->name, cur->atype, tree->name);
6572 if ((ret == 0) && (ctxt->valid == 1))
6573 ctxt->valid = 0;
6574 tree = tree->next;
6575 }
6576 }
6577 }
6578 if (cur->atype == XML_ATTRIBUTE_NOTATION) {
6579 const xmlChar *elemLocalName;
6580 xmlChar *elemPrefix;
6581
6582 doc = cur->doc;
6583 if (cur->elem == NULL) {
6584 xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR,
6585 "xmlValidateAttributeCallback(%s): internal error\n",
6586 (const char *) cur->name);
6587 return;
6588 }
6589
6590 elemLocalName = xmlSplitQName4(cur->elem, &elemPrefix);
6591 if (elemLocalName == NULL) {
6592 xmlVErrMemory(ctxt);
6593 return;
6594 }

Callers

nothing calls this directly

Calls 4

xmlSplitQName4Function · 0.85
xmlVErrMemoryFunction · 0.85
xmlHashLookup2Function · 0.85

Tested by

no test coverage detected