Xpath question
Posted: Thu Dec 28, 2017 4:55 pm
I have an XML document that contains elements in one node GROUP that have attributes CLIENTID, LAST_NAME, FIRST_NAME and PREFIX_NAME. In another node CASESTEP are attributes CLIENTNAME and SCHOOLNAME. The CLIENTNAME consists of "PREFIX_NAME LAST_NAME, FIRST_NAME". For example my own name: "Van Erkel, Raymond".
Is there a way to use XPATH to search my XML file for the CLIENTID based upon the occurence of FIRST_NAME (in the one note) in CLIENTNAME (in the other note)? Also for the SCHOOLNAME. I dont't want to show the CLIENTIDs of all GROUP MEMBERS.
In the example below I want to have '123' as the result of the occurence of 'Raymond' in 'Van Erkel, Raymond'. Also 'Abc' as the result for SCHOOLNAME.
-<GROUP>
-<MEMBER>
<CLIENT_ID>123</CLIENT_ID>
<FIRST_NAME>Raymond</FIRST_NAME>
<LAST_NAME>Erkel</LAST_NAME>
<PREFIX_NAME>van</PREFIX_NAME>
-<CASESTEP>
<QUESTION_321_CLIENTNAME>Van Erkel, Raymond</QUESTION_321_CLIENTNAME>
<SCHOOLNAME>Abc</SCHOOL>
I tried contains and substring_after functions but I can't get it to work. Please help me out.
Is there a way to use XPATH to search my XML file for the CLIENTID based upon the occurence of FIRST_NAME (in the one note) in CLIENTNAME (in the other note)? Also for the SCHOOLNAME. I dont't want to show the CLIENTIDs of all GROUP MEMBERS.
In the example below I want to have '123' as the result of the occurence of 'Raymond' in 'Van Erkel, Raymond'. Also 'Abc' as the result for SCHOOLNAME.
-<GROUP>
-<MEMBER>
<CLIENT_ID>123</CLIENT_ID>
<FIRST_NAME>Raymond</FIRST_NAME>
<LAST_NAME>Erkel</LAST_NAME>
<PREFIX_NAME>van</PREFIX_NAME>
-<CASESTEP>
<QUESTION_321_CLIENTNAME>Van Erkel, Raymond</QUESTION_321_CLIENTNAME>
<SCHOOLNAME>Abc</SCHOOL>
I tried contains and substring_after functions but I can't get it to work. Please help me out.