I tried in set value opr:
Location: strEmail is String var in process
Expression: myXML is XML var in process
strEmail = '
But didn't getting it. Pls help.
In your xml document, email is a node - not an attribute.
The xPath expression should be:
The location uses the @strEmail notation because as an LC process variable, it's a simple value (String) and treated as an attribute of the process.
Thanks Marcel for your response. I tried the way you told, but still I am not getting the node value from xml.
strEmail is still null/blank. I checked myXML variable, it holds the proper XML as above.
I am stucked in it, help!!.
Your xpath doesn't match your XML - you are missing the root node in your xpath expression:
When you build your loop there is one other thing to be careful of. If you evaluate an xpath variable inside of another xpath expression, it gets inserted as a string. This happens even if the variable is an integer. For example: If I have an integer variable counter which is set to 3 and evaluate:
/process_data/myXML/root/records/record[/process_data/@counter]/email The xpath expression will insert "3" (a string) and not an integer as you would expect. The result will not be the third node. This can be a source of frustration and its hard to debug.
Instead, use the number function inside the expression:
I've attached a sample process that shows this.
XMLLoop.process.zip 1.8 K