How to pass Xpath Dyanamic Values

How to pass Xpath Dyanamic Values

Is there a way to pass the dynamic Xpath values to the loop 

The reason behind is that when i'm using XMLnodelist to count the sub_nodes from the XML file the system provides the correct information as I'm giving the direct path to the particular node.

The challenge for me right now is that I would like to have those node values to be imported to the Database which is driving me crazy... 

The system is counting the number of node records "Which means every row is one record" when it iterates its not moving to second record but it is moving only to first record to the number of times it has counted earlier in xmlnodelist_count

Please guide me 

You can make a xsd (Schema) file for this xml which declares the structure for the result values,
I think it should work. and then parsing can help you to fetch records values from the structure.

Ity Sharma

The loop is simple if you have the list.

XmlNodeList_Count is the max
Then you need to use XmlNodeList_Item to retrieve an item based on index.
and please, make your code more maintainable and readable by splitting it up in seperate actions...

Thanks J 
Well we have followed the same plan as you mentined earlier but the main issue is that its counting the number of nodes but only the values...

I don't understand.

Please provide us with a simple oml with the bare minimum of code for the issue you are having.
The reason I ask, the image you are showing is simply too much.
I cannot see the loop (well I can, but it's not straighforward)
Pieces of code that is working should be placed into a different action, so you can test stuff incremental.
skipping pieces should help as well.

What you are trying to do now it stuffing the whole process into one action and that is simply untestable.

and last, I still cannot figure out why you make it so complex for yourself.

xml2recordlist can work for you
xslt might be better.
a simple replace "placeholder" by the new xml

Hello J,

Please check the attached OML. Inside "credit" action of "PreCredit" page, we are calling that XML and storing required fields in the database. 

Here what's happening is that when I traverse through the loop, only first subnodes data gets stored throughout the loop. It's not pointing to next subnode.

We tried using xml2recordlist, but it needs one recordlist parameter and we don't have structure of XML which we could pass to recordlist parameter.

Please look into this. 


The loop itself looks good...but then whe you start doing the Xpaths inside the loop you stop using what you have read in

You already are iterating correcty all CREDIT_LIABILITY nodes and getting each of them in the XmlNodeList_Item.XmlNode. If you want to read an attribute from it you need to call the XmlElement_GetAttribute action with it ...instead of doing a new Xpath in the complete XML file...

Hope it helped.

João Rosado
thanks João Rosado I will test your logic now...