troubleshooting Question

return part of xml to JSON after a xpath search

Avatar of Neil Thompson
Neil ThompsonFlag for United Kingdom of Great Britain and Northern Ireland asked on
XMLPHP
1 Comment1 Solution132 ViewsLast Modified:
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

one of the 3 councillor nodes for Cheriton ward

I hope that makes sense, if not please shout :(
ASKER CERTIFIED SOLUTION
Zvonko
Systems architect
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros