Link to home
Get AccessLog in
Avatar of Neil Thompson
Neil ThompsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

return part of xml to JSON after a xpath search

Hi all

I want to be able to pass a "wardTitle" variable to the XML from this page and be able to save just the resulting details as json.

The following returns a XML file of all our councillors and their details. I want to be able to filter on the passed "wardTitle" and only then return the details associated with the councillors who come under that wardtitle

https://www.folkestone-hythe.gov.uk/moderngov/mgWebService.asmx/GetCouncillorsByWard


For example If I pass "Cheriton Ward" only the node <wardtitle>Cheriton Ward</wardtitle> would be returned with all it's children so thats the <councillors node> and 3 <councillor> nodes with their associated content

I have tried using xpath but It then seems really cumbersome to iterate through every single node rather than just be able to grab that and convert it to json

User generated image

I hope that makes sense, if not please shout :(
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access