* xmlRelaxNGSchemaTypeCheck: * @data: data needed for the library * @type: the type name * @value: the value to check * @node: the node * * Check if the given type and value are validated by * the W3C XMLSchema Datatype library. * * Returns 1 if yes, 0 if no and -1 in case of error. */
| 2413 | * Returns 1 if yes, 0 if no and -1 in case of error. |
| 2414 | */ |
| 2415 | static int |
| 2416 | xmlRelaxNGSchemaTypeCheck(void *data ATTRIBUTE_UNUSED, |
| 2417 | const xmlChar * type, |
| 2418 | const xmlChar * value, |
| 2419 | void **result, xmlNodePtr node) |
| 2420 | { |
| 2421 | xmlSchemaTypePtr typ; |
| 2422 | int ret; |
| 2423 | |
| 2424 | if ((type == NULL) || (value == NULL)) |
| 2425 | return (-1); |
| 2426 | typ = xmlSchemaGetPredefinedType(type, |
| 2427 | BAD_CAST |
| 2428 | "http://www.w3.org/2001/XMLSchema"); |
| 2429 | if (typ == NULL) |
| 2430 | return (-1); |
| 2431 | ret = xmlSchemaValPredefTypeNode(typ, value, |
| 2432 | (xmlSchemaValPtr *) result, node); |
| 2433 | if (ret == 2) /* special ID error code */ |
| 2434 | return (2); |
| 2435 | if (ret == 0) |
| 2436 | return (1); |
| 2437 | if (ret > 0) |
| 2438 | return (0); |
| 2439 | return (-1); |
| 2440 | } |
| 2441 | |
| 2442 | /** |
| 2443 | * xmlRelaxNGSchemaFacetCheck: |
nothing calls this directly
no test coverage detected