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

Function xmlParseCRNG_bindDatatypePrefix

ThirdParty/libxml2/vtklibxml2/rngparser.c:524–550  ·  view source on GitHub ↗

* xmlParseCRNG_bindDatatypePrefix: * @ctxt: a compact RNG parser context * @prefix: the datatype prefix * @namespace: the datatype identifier * * implements bindDatatypePrefix of the RELAX NG Compact Syntax Appendix A * * Returns 0 in case of success and -1 in case of error */

Source from the content-addressed store, hash-verified

522 * Returns 0 in case of success and -1 in case of error
523 */
524static int
525xmlParseCRNG_bindDatatypePrefix(xmlCRelaxNGParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
526 const xmlChar *prefix,
527 const xmlChar *namespace)
528{
529 int ret;
530
531 if ((prefix != NULL) && (xmlStrEqual(prefix, BAD_CAST "xsd")) &&
532 (!xmlStrEqual(namespace,
533 BAD_CAST "http://www.w3.org/2001/XMLSchema-datatypes"))) {
534 ERROR("The \"xsd\" prefix must be bound to \"http://www.w3.org/2001/XMLSchema-datatypes\"");
535 return(-1);
536 }
537 if (ctxt->datatypes == NULL)
538 ctxt->datatypes = xmlHashCreate(10);
539 if (ctxt->datatypes == NULL) {
540 ERROR("Failed to create namespace hash table");
541 return(-1);
542 }
543 ret = xmlHashAddEntry(ctxt->datatypes, prefix,
544 (void *) namespace);
545 if (ret < 0) {
546 ERROR("Redefinition of datatype");
547 return(-1);
548 }
549 return(0);
550}
551
552/**
553 * xmlParseCRNG_lookupPrefix:

Callers 1

xmlParseCRNG_declFunction · 0.85

Calls 3

xmlStrEqualFunction · 0.85
xmlHashCreateFunction · 0.85
xmlHashAddEntryFunction · 0.85

Tested by

no test coverage detected