42 char* pWhitespaceChars,
45 char* pBuff = pTokenBuffer;
48 while ( **pPosInBuffer )
50 if ( strchr(pBreakChars,**pPosInBuffer) != NULL )
54 return *((*pPosInBuffer)++);
58 if ( strchr(pWhitespaceChars, **pPosInBuffer) != NULL )
61 *pBuff++ = *((*pPosInBuffer)++);
65 *pBuff++ = *((*pPosInBuffer)++);
66 return(**pPosInBuffer);
92 yaz_log(YLOG_WARN,
"Attempting to lookup data for tagpath: Child node is not a data node");
97 yaz_log(YLOG_WARN,
"Found a node matching the tagpath, but it has no child data nodes");
102 yaz_log(YLOG_WARN,
"Unable to lookup a node on the specified tag path");
110 #define MAX_TAG_SIZE 50
124 char* pCurrCharInPath = pTagPath;
144 StringTagVal[0] =
'\0';
152 iTagType = atoi(Buffer);
158 strcpy(StringTagVal,Buffer);
160 iTagValue = atoi(Buffer);
166 iOccurences = atoi(Buffer);
176 yaz_log(YLOG_FATAL,
"Node does not end with a ]");
185 strcpy(StringTagVal,Buffer);
191 iOccurences = atoi(Buffer);
199 yaz_log(YLOG_DEBUG,
"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences);
205 while ( ( current_child ) && ( matched_node == NULL ) )
211 if ( ( current_child->
u.
tag.element == NULL ) &&
212 ( strcmp(current_child->
u.
tag.tag, StringTagVal) == 0 ) )
224 matched_node = current_child;
230 yaz_log(YLOG_WARN,
"Non string tag matching not yet implemented");
233 current_child = current_child->
next;
238 if ( ( sepchr ==
'.' ) && ( matched_node ) )
269 for ( current_child = pParent->
child;
271 current_child = current_child->
next )
275 if ( current_child->
u.
tag.element == NULL )
277 if ( ( n->
u.
tag.tag ) &&
278 ( current_child->
u.
tag.tag ) &&
279 ( strcmp(current_child->
u.
tag.tag, n->
u.
tag.tag) == 0 ) )
284 else if ( current_child->
u.
tag.element == n->
u.
tag.element )
data1_node * data1_LookupNode(data1_node *node, char *pTagPath)
int data1_CountOccurences(data1_node *node, char *pTagPath)
Count the number of occurences of the last instance on a tagpath.
char data1_ScanNextToken(char *pBuffer, char **pPosInBuffer, char *pBreakChars, char *pWhitespaceChars, char *pTokenBuffer)
char * data1_getNodeValue(data1_node *node, char *pTagPath)
struct data1_node * parent
struct data1_node * child