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

Function xmlSchemaFormatIDCKeySequence_1

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:22499–22537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22497}
22498
22499static const xmlChar *
22500xmlSchemaFormatIDCKeySequence_1(xmlSchemaValidCtxtPtr vctxt,
22501 xmlChar **buf,
22502 xmlSchemaPSVIIDCKeyPtr *seq,
22503 int count, int for_hash)
22504{
22505 int i, res;
22506 xmlChar *value = NULL;
22507
22508 *buf = xmlStrdup(BAD_CAST "[");
22509 for (i = 0; i < count; i++) {
22510 *buf = xmlStrcat(*buf, BAD_CAST "'");
22511 if (!for_hash)
22512 res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
22513 xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
22514 &value);
22515 else {
22516 res = xmlSchemaGetCanonValueHash(seq[i]->val, &value);
22517 }
22518 if (res == 0)
22519 *buf = xmlStrcat(*buf, BAD_CAST value);
22520 else {
22521 VERROR_INT("xmlSchemaFormatIDCKeySequence",
22522 "failed to compute a canonical value");
22523 *buf = xmlStrcat(*buf, BAD_CAST "???");
22524 }
22525 if (i < count -1)
22526 *buf = xmlStrcat(*buf, BAD_CAST "', ");
22527 else
22528 *buf = xmlStrcat(*buf, BAD_CAST "'");
22529 if (value != NULL) {
22530 xmlFree(value);
22531 value = NULL;
22532 }
22533 }
22534 *buf = xmlStrcat(*buf, BAD_CAST "]");
22535
22536 return (BAD_CAST *buf);
22537}
22538
22539static const xmlChar *
22540xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,

Callers 2

xmlSchemaHashKeySequenceFunction · 0.85

Calls 5

xmlStrdupFunction · 0.85
xmlStrcatFunction · 0.85

Tested by

no test coverage detected