Murari has asked for the wisdom of the Perl Monks concerning the following question:
and the required output format is:<?xml version="1.0" encoding="UTF-8"?> <response> <result name="response" numFound="58582" start="0"> <doc> <str name="body">Have a great time at this park!</str><int name="is_pa +rk_id">317851</int><str name="ss_image_thumb_small"/> <str name="title">Playground</str> </doc> <doc> <str name="body">Have a great time at this park!</str><int name="is_pa +rk_id">317851</int><str name="ss_image_thumb_small"/> <str name="title">Playground</str> </doc> </result> </response>
<str name="body"> should be treated as description, <int name="is_park_id"> should be treated as <ExternalId> and <str name="title"> should be treated as <Name>. Could you help in formatting the XML to new format?<?xml version="1.0" encoding="iso-8859-1"?> <Feed> <Products> <Product> <Description>Have a great time at this park!</Description><ExternalId> +PF317851</ExternalId><ImageUrl/> <Name>Playground</Name> </Product> <Product> <Description>Have a great time at this park!</Description><ExternalId> +PF317851</ExternalId><ImageUrl/> <Name>Playground</Name> </Product> </Products> </Feed>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl - Modify the nested XML tags
by tobyink (Canon) on Jan 11, 2013 at 21:05 UTC | |
by Murari (Initiate) on Jan 14, 2013 at 15:19 UTC | |
by Anonymous Monk on Jan 14, 2013 at 15:25 UTC | |
|
Re: Perl - Modify the nested XML tags
by choroba (Cardinal) on Jan 11, 2013 at 23:32 UTC | |
|
Re: Perl - Modify the nested XML tags
by locked_user sundialsvc4 (Abbot) on Jan 11, 2013 at 22:26 UTC | |
by tobyink (Canon) on Jan 12, 2013 at 11:51 UTC |