02-01-2013 12:01 AM - edited 03-14-2019 11:11 AM
After tweak bunch of times the argument inside "Get XML Document Data" I´m still not able to obtain a no null value. Could someone help me to find out what i´m doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<Holidays>
<Holiday>Date=1/2/2013</Holiday>
<Holiday>Date=1/2/2013</Holiday>
<Holiday>Date=8/4/2013</Holiday>
<Holiday>Date=9/4/2013</Holiday>
<Holiday>Date=1/5/2013</Holiday>
<Holiday>Date=17/5/2013</Holiday>
<Holiday>Date=27/5/2013</Holiday>
<Holiday>Date=6/6/2013</Holiday>
<Holiday>Date=23/6/2013</Holiday>
<Holiday>Date=6/4/2013</Holiday>
<Holiday>Date=25/12/2013</Holiday>
<Holiday>Date=26/12/2013</Holiday>
</Holidays>
Xpath:
"/descendant::Holidays/child::Holiday[attribute::symbol='DateString']/child::LAST"
thank in advance.
Solved! Go to Solution.
02-01-2013 02:17 AM
Hi,
(sigh). Alright.
1. Modify your XML:
2. Modify your XPath:
"/Holidays/Holiday[text()='" + needle + "']"
needle is a String variable that contains the value you want to match in the above XML. In your case its name is "DateString".
This XPath will return a String (actually, the match) if it matches so if needle=='1/2/2013', it will return '1/2/2013'
It will return null if there's no match.
G.
02-01-2013 12:38 AM
Hi,
what is it you are trying to achieve?
G.
02-01-2013 01:46 AM
Hi,
The script first obtain today´s date in this format 1/2/2013 and stores in DateString variable. Then create a XML document based on this:
that i´ve upload to uccx. it uses get XML Document Data function and stores the result in DataResult variable.
if
DataResult == null meets True it makes a call redirect to an extension
if false that means "1/2/2013" was found inside the XML archive and sends to another extension.
The problem i see through reactive debug is that always return null,
In brief: I do not know how to tell using the function "find 1/2/2013 inside Holidays.xml document"
this is what I putted inside get XML Document Data function:
"/descendant::Holidays/child::Holiday[attribute::symbol='DateString']/child::LAST"
02-01-2013 02:17 AM
Hi,
(sigh). Alright.
1. Modify your XML:
2. Modify your XPath:
"/Holidays/Holiday[text()='" + needle + "']"
needle is a String variable that contains the value you want to match in the above XML. In your case its name is "DateString".
This XPath will return a String (actually, the match) if it matches so if needle=='1/2/2013', it will return '1/2/2013'
It will return null if there's no match.
G.
02-01-2013 02:57 AM
It worked good, thank you so much! you saved my live! jejeje
02-01-2013 02:59 AM
Glad it worked out and thanks for the rating.
G.
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