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

Function xmlXPathIsAxisName

ThirdParty/libxml2/vtklibxml2/xpath.c:10155–10201  ·  view source on GitHub ↗

* xmlXPathIsAxisName: * @name: a preparsed name token * * [6] AxisName ::= 'ancestor' * | 'ancestor-or-self' * | 'attribute' * | 'child' * | 'descendant' * | 'descendant-or-self' * | 'following' * | 'following-sibling' * | 'namespace' *

Source from the content-addressed store, hash-verified

10153 * Returns the axis or 0
10154 */
10155static xmlXPathAxisVal
10156xmlXPathIsAxisName(const xmlChar *name) {
10157 xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
10158 switch (name[0]) {
10159 case 'a':
10160 if (xmlStrEqual(name, BAD_CAST "ancestor"))
10161 ret = AXIS_ANCESTOR;
10162 if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
10163 ret = AXIS_ANCESTOR_OR_SELF;
10164 if (xmlStrEqual(name, BAD_CAST "attribute"))
10165 ret = AXIS_ATTRIBUTE;
10166 break;
10167 case 'c':
10168 if (xmlStrEqual(name, BAD_CAST "child"))
10169 ret = AXIS_CHILD;
10170 break;
10171 case 'd':
10172 if (xmlStrEqual(name, BAD_CAST "descendant"))
10173 ret = AXIS_DESCENDANT;
10174 if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
10175 ret = AXIS_DESCENDANT_OR_SELF;
10176 break;
10177 case 'f':
10178 if (xmlStrEqual(name, BAD_CAST "following"))
10179 ret = AXIS_FOLLOWING;
10180 if (xmlStrEqual(name, BAD_CAST "following-sibling"))
10181 ret = AXIS_FOLLOWING_SIBLING;
10182 break;
10183 case 'n':
10184 if (xmlStrEqual(name, BAD_CAST "namespace"))
10185 ret = AXIS_NAMESPACE;
10186 break;
10187 case 'p':
10188 if (xmlStrEqual(name, BAD_CAST "parent"))
10189 ret = AXIS_PARENT;
10190 if (xmlStrEqual(name, BAD_CAST "preceding"))
10191 ret = AXIS_PRECEDING;
10192 if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
10193 ret = AXIS_PRECEDING_SIBLING;
10194 break;
10195 case 's':
10196 if (xmlStrEqual(name, BAD_CAST "self"))
10197 ret = AXIS_SELF;
10198 break;
10199 }
10200 return(ret);
10201}
10202
10203/**
10204 * xmlXPathCompStep:

Callers 1

xmlXPathCompStepFunction · 0.85

Calls 1

xmlStrEqualFunction · 0.85

Tested by

no test coverage detected