Tue Jun 25, 2019 3:26 am
Login Register Lost Password? Contact Us


IPropertyTree: Ambiguous xpath used getProp

Questions around writing code and queries

Wed Apr 10, 2019 6:23 pm Change Time Zone

what causes these kinds on errors on a cluster ? Is this related to the clusters’s package file ?

IPropertyTree: Ambiguous xpath used getProp: ambiguous xpath "Alias[@id='abc.searchservice.16']"

‘wsWorkunits.WUListQueries IpropertyTree: Ambigous Xpath used getProp: ambiguous xpath “Alias[@id=’xyz.searchservices.57’]”

This is actually causing the cluster to become unstable.

Is there a way in which we can prevent this. Currently the only way we have been able to fix this is to delete the listed query.
rati
 
Posts: 4
Joined: Wed Oct 23, 2013 2:51 pm

Wed Apr 10, 2019 7:45 pm Change Time Zone

rati,

I've seen that error message, and for me the problem has always been that the XPATHs in the RECORD structure are not correctly configured, such that the library is confused about exactly how to find the data.

Here's my most recent example of that:
Code: Select all
//trying to define this data:   
req := '<ROW>'+
         '<test:request> '+
            '<dapp:IDD>16212321321j321n3kj21j3kn213</dapp:IDD>'+
            '<dapp:Request>'+
               '<dapp:RecordReqGetRec>'+
                  '<dapp:AfterTimeStamp>2018-03-11</dapp:AfterTimeStamp>'+
                  '<dapp:StatusCodes>'+
                     '<arr:string>NFFF</arr:string>'+
                     '<arr:string>NPPP</arr:string>'+
                  '</dapp:StatusCodes>'+
               '</dapp:RecordReqGetRec>'+
            '</dapp:Request>'+
         '</test:request>'+
       '</ROW>';
The "problem" here, of course, is getting the nested child dataset entries (arr:string) correctly defined.

My first attempt was to define it like this:
Code: Select all
layout := RECORD
  STRING arrString{XPATH('arr:string')}; 
END;
rLex := RECORD
  STRING dappIDD{XPATH('test:request/dapp:IDD')};   
  STRING  AfterTimeStamp{XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:AfterTimeStamp')};
  DATASET(Layout) StatusCodes{ XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:StatusCodes')};
  STRING arrString1{XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:StatusCodes/arr:string[1]')};
  STRING arrString2{XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:StatusCodes/arr:string[2]')};
END;

FROMXML(rLex,req);
Which did NOT work, and got the same error you're talking about.

The solution was to change the XPATHs this way:
Code: Select all
layout := RECORD
  STRING arrString{XPATH('')}; // get self..
END;
rLex := RECORD
  STRING dappIDD{XPATH('test:request/dapp:IDD')}; 
  STRING  AfterTimeStamp{XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:AfterTimeStamp')};
  DATASET(Layout) StatusCodes{ XPATH('test:request/dapp:Request/dapp:RecordReqGetRec/dapp:StatusCodes/arr:string')};
END;

FROMXML(rLex,req);
This DOES work.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1459
Joined: Wed Oct 26, 2011 7:40 pm

Thu Apr 18, 2019 10:47 pm Change Time Zone

Thanks Richard,
I created this error by re-naming a major input dataset. So what you are saying is very much possible in my case too.

Regards,
Rati
rati
 
Posts: 4
Joined: Wed Oct 23, 2013 2:51 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron