Filter an xml file while parsing
Posted: Wed Mar 10, 2010 11:54 am
Hi,
So lets say I have the following xml file:
And I want to tabulate this data without having a field for Gender in the table. Does anyone know how to go about filtering such an xml file when parsing (with php) such that only selected fields are parsed?
I will also add that the xml feed is hosted remotely and I cannot edit it.
Thanks.
So lets say I have the following xml file:
Code: Select all
<DATABASE> <PERSON> <NAME>Jon</NAME> <SURNAME>Doe</SURNAME> <GENDER>Male</GENDER> <AGE>23</AGE> </PERSON> <PERSON> <NAME>Jane</NAME> <SURNAME>Doe</SURNAME> <GENDER>Female</GENDER> <AGE>21</AGE> </PERSON></DATABASE> I will also add that the xml feed is hosted remotely and I cannot edit it.
Thanks.