I have been doing PHP for years. I am having a bit of difficulty trying to parse this XML file (below is a sample). Usually, I do not run into any problems, however I have not dealt trying to single out the "value" in each temperature.
For the past few years I had been using the Data Feed from Weather.com. That feed I parsed, however the feed from the NWS is a little different.
Unfortunately, I need to switch the weather from them to using the NWS feed.
I desire to display each value for maximum and minimum. I request any assist anyone can offer. This will give me the information I can proceed with. I am not proud to accept anyone's parsing ideas for the NWS feed.
<?xml version="1.0"?>
<dwml version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/forecasts/xml/DWMLgen/sch\
ema/DWML.xsd">
<data>
<parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature</name>
<value>80</value>
<value>82</value>
<value>78</value>
<value>75</value>
<value>78</value>
<value>76</value>
<value>77</value>
</temperature>
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n7-2">
<name>Daily Minimum Temperature</name>
<value>57</value>
<value>54</value>
<value>55</value>
<value>52</value>
<value>53</value>
<value>52</value>
<value>51</value>
</temperature>
</parameters>
</data>
</dwml>