MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / xmlXPathStringFunction

Function xmlXPathStringFunction

Externals/LibXML/xpath.c:8776–8792  ·  view source on GitHub ↗

* xmlXPathStringFunction: * @ctxt: the XPath Parser context * @nargs: the number of arguments * * Implement the string() XPath function * string string(object?) * The string function converts an object to a string as follows: * - A node-set is converted to a string by returning the value of * the node in the node-set that is first in document order. * If the node-set is

Source from the content-addressed store, hash-verified

8774 * context node as its only member.
8775 */
8776void
8777xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs) {
8778 xmlXPathObjectPtr cur;
8779
8780 if (ctxt == NULL) return;
8781 if (nargs == 0) {
8782 valuePush(ctxt,
8783 xmlXPathCacheWrapString(ctxt->context,
8784 xmlXPathCastNodeToString(ctxt->context->node)));
8785 return;
8786 }
8787
8788 CHECK_ARITY(1);
8789 cur = valuePop(ctxt);
8790 if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
8791 valuePush(ctxt, xmlXPathCacheConvertString(ctxt->context, cur));
8792}
8793
8794/**
8795 * xmlXPathStringLengthFunction:

Callers 1

Calls 5

valuePushFunction · 0.85
xmlXPathCacheWrapStringFunction · 0.85
xmlXPathCastNodeToStringFunction · 0.85
valuePopFunction · 0.85

Tested by 1