Discussion
Randstad Technologies US
US
Last activity: 1 Sep 2015 3:16 EDT
How to parse xml for repeat elements
I have a sample xml like this.
<NewDataSet> <Table> <Country>British Indian Ocean Territory</Country> <City>Diego Garcia</City> </Table> <Table> <Country>India</Country> <City>Ahmadabad</City> </Table> <Table> <Country>India</Country> <City>Akola</City> </Table> <Table> <Country>India</Country> <City>Aurangabad Chikalthan Aerodrome</City> </Table> <Table> <Country>India</Country> <City>Bombay / Santacruz</City> </Table> <Table> <Country>India</Country> <City>Bilaspur</City> </Table> <Table> <Country>India</Country> <City>Bhuj-Rudramata</City> </Table> </NewDataSet>
in this Newdataset is a root element.Table elemnet is repeatable.
i tried to write parse xml for that xml like this
when i run it,
i am getting only first table elements values only.
i also made Table element repeatable.
My aim is to get all the city values.
your help is most appreciated.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
NIIT Technologies Limited
AU
Please check below support articles -
https://community.pega.com/support/support-articles/xml-parsing-rule-does-not-map-all-values
Randstad Technologies US
US
its not a soap request that i am trying. i manually ran the parse xml file by providing the xml content by using run command.
PEG
IN
Hi,
Can you set the Dynamic System Setting (DSS) to true.
SwitchToOldAssembler - Pega-IntegrationEngine -true
It should work. May I know which version of PRPC you are in?
NIIT Technologies Limited
AU
Issue is not with the SOAP, it is in parse XML. Parse xml will be using new assembler when run through SOAP or manually.
Please create the DASS mentioned in the support article and test once.
Thanks.
Randstad Technologies US
US
I set the value in DSS but no luck.
PEG
IN
May I know which PRPC Version you are in? I tested in 7.1.7 it worked.
NIIT Technologies Limited
AU
Did you set owning ruleset = Pega-IntegrationEngine in the DASS?
Randstad Technologies US
US
yes..i set the rule set as Pega-IntegrationEngine
Areteans Technology
IN
This seems to be a bug. contact support team.
Updated: 1 Sep 2015 2:31 EDT
Randstad Technologies US
US
Issue has been solved.We need to do the following things..
- A class "XXX-Data-Table", which contains two properties: Country, City.
- A class "XXX-Data-NewDataSet", which contains one Page List property of the class "XXX-Data-Table".
Then, in your parse XML, you want to populate a page of the class "XXX-Data-NewDataSet" (this page will store the results of the parsing). The element Table of your Parse XML should be mapped to the Page List property that you have defined at "XXX-Data-NewDataSet". The other two properties should be mapped to the properties you have defined at "XXX-Data-Table".
Areteans Technology
IN
Did you have to do the DSS change along with this ?
Randstad Technologies US
US
No need