10-24-2016 09:16 AM - edited 03-14-2019 04:41 PM
Hi,
I've a long XML (~84000 lines) file that i'm using to make ANI Based routing, but my customer is giving me the file with the following format
<?xml version="1.0" encoding="utf-8"?>
<ZCCRELTFNO>
<item>
<TEL_NUMBER>5652</TEL_NUMBER>
<AGENT>agente3</AGENT>
</item>
</ZCCRELTFNO>
I can't do the "//descendant::ZCCRELTFNO/child::item["+i+"]/child::AGENT" with the increment i because the file is to long and takes to much time.
With the format below i can do it on one shot by using "//item[@TEL_NUMBER="+callingNumber+"]/@AGENT"
<?xml version="1.0" encoding="utf-8"?>
<ZCCRELTFNO>
<item TEL_NUMBER="5652" AGENT="agente3"</item>
</ZCCRELTFNO>
Is there any xpath that i can use to get the the AGENT with the Phone number without having to use the recursive i increment, like its done on the 2nd XML format.
Thanks
10-25-2016 08:56 AM
I'm sorry I have no clue how to actually answer or help you with your specific question, but I would say that you need to stop going down this route and just go with a DB lookup or create a webservice to give you the information you're looking for. I can't imagine that a 84000 line XML file is a sustainable method to continue doing business.
david
10-25-2016 10:31 AM
I know that was the right thing to do, but the customer has no license and does not want to spend some money.
Just for the reference i got it working with the following XPATH and it is really fast, ~1s to find the last entry.
"/ZCCRELTFNO/item[TEL_NUMBER="+callingNumber+"]/AGENT"
10-26-2016 06:04 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide