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

Function xmlRelaxNGGetDataTypeLibrary

ThirdParty/libxml2/vtklibxml2/relaxng.c:3381–3423  ·  view source on GitHub ↗

* xmlRelaxNGGetDataTypeLibrary: * @ctxt: a Relax-NG parser context * @node: the current data or value element * * Applies algorithm from 4.3. datatypeLibrary attribute * * Returns the datatypeLibrary value or NULL if not found */

Source from the content-addressed store, hash-verified

3379 * Returns the datatypeLibrary value or NULL if not found
3380 */
3381static xmlChar *
3382xmlRelaxNGGetDataTypeLibrary(xmlRelaxNGParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
3383 xmlNodePtr node)
3384{
3385 xmlChar *ret, *escape;
3386
3387 if (node == NULL)
3388 return(NULL);
3389
3390 if ((IS_RELAXNG(node, "data")) || (IS_RELAXNG(node, "value"))) {
3391 ret = xmlGetProp(node, BAD_CAST "datatypeLibrary");
3392 if (ret != NULL) {
3393 if (ret[0] == 0) {
3394 xmlFree(ret);
3395 return (NULL);
3396 }
3397 escape = xmlURIEscapeStr(ret, BAD_CAST ":/#?");
3398 if (escape == NULL) {
3399 return (ret);
3400 }
3401 xmlFree(ret);
3402 return (escape);
3403 }
3404 }
3405 node = node->parent;
3406 while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
3407 ret = xmlGetProp(node, BAD_CAST "datatypeLibrary");
3408 if (ret != NULL) {
3409 if (ret[0] == 0) {
3410 xmlFree(ret);
3411 return (NULL);
3412 }
3413 escape = xmlURIEscapeStr(ret, BAD_CAST ":/#?");
3414 if (escape == NULL) {
3415 return (ret);
3416 }
3417 xmlFree(ret);
3418 return (escape);
3419 }
3420 node = node->parent;
3421 }
3422 return (NULL);
3423}
3424
3425/**
3426 * xmlRelaxNGParseValue:

Callers 2

xmlRelaxNGParseValueFunction · 0.85
xmlRelaxNGParseDataFunction · 0.85

Calls 2

xmlGetPropFunction · 0.85
xmlURIEscapeStrFunction · 0.85

Tested by

no test coverage detected