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

Function xmlXPathConvertString

ThirdParty/libxml2/vtklibxml2/xpath.c:4810–4845  ·  view source on GitHub ↗

* xmlXPathConvertString: * @val: an XPath object * * Converts an existing object to its string() equivalent * * Returns the new object, the old one is freed (or the operation * is done directly on @val) */

Source from the content-addressed store, hash-verified

4808 * is done directly on @val)
4809 */
4810xmlXPathObjectPtr
4811xmlXPathConvertString(xmlXPathObjectPtr val) {
4812 xmlChar *res = NULL;
4813
4814 if (val == NULL)
4815 return(xmlXPathNewCString(""));
4816
4817 switch (val->type) {
4818 case XPATH_UNDEFINED:
4819 break;
4820 case XPATH_NODESET:
4821 case XPATH_XSLT_TREE:
4822 res = xmlXPathCastNodeSetToString(val->nodesetval);
4823 break;
4824 case XPATH_STRING:
4825 return(val);
4826 case XPATH_BOOLEAN:
4827 res = xmlXPathCastBooleanToString(val->boolval);
4828 break;
4829 case XPATH_NUMBER:
4830 res = xmlXPathCastNumberToString(val->floatval);
4831 break;
4832 case XPATH_USERS:
4833#ifdef LIBXML_XPTR_LOCS_ENABLED
4834 case XPATH_POINT:
4835 case XPATH_RANGE:
4836 case XPATH_LOCATIONSET:
4837#endif /* LIBXML_XPTR_LOCS_ENABLED */
4838 /* TODO */
4839 break;
4840 }
4841 xmlXPathFreeObject(val);
4842 if (res == NULL)
4843 return(xmlXPathNewCString(""));
4844 return(xmlXPathWrapString(res));
4845}
4846
4847/**
4848 * xmlXPathCastBooleanToNumber:

Callers

nothing calls this directly

Calls 6

xmlXPathNewCStringFunction · 0.85
xmlXPathFreeObjectFunction · 0.85
xmlXPathWrapStringFunction · 0.85

Tested by

no test coverage detected