View attachment 43276 Hi
How to get all locationName's value as following xml file ?
I try "Dim xml As SaxParser" to get value but i can get Name and I cann't get Attributes?
How to get all locationName's value as following xml file ?
I try "Dim xml As SaxParser" to get value but i can get Name and I cann't get Attributes?
B4X:
<?xml version="1.0" encoding="UTF-8"?>
-<cwbopendata xmlns="urn:cwb:gov:tw:cwbcommon:0.1">
<identifier>0fa9df43-31f8-479d-b0b9-39cccdec62ce</identifier>
<sender>[email protected]</sender>
<sent>2016-04-16T17:35:46+08:00</sent>
<status>Actual</status>
<msgType>Issue</msgType>
<dataid>CWB_A0001</dataid>
<scope>Public</scope>
<dataset/>
-<location>
<lat>24.9943</lat>
<lon>121.3150</lon>
<locationName>桃園</locationName>
<stationId>C0C480</stationId>
-<time>
<obsTime>2016-04-16T17:30:00+08:00</obsTime>
</time>
-<weatherElement>
<elementName>ELEV</elementName>
-<elementValue>
<value>105.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDIR</elementName>
-<elementValue>
<value>106.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDSD</elementName>
-<elementValue>
<value>1.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>TEMP</elementName>
-<elementValue>
<value>29.4</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>HUMD</elementName>
-<elementValue>
<value>0.59</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>PRES</elementName>
-<elementValue>
<value>996.3</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>SUN</elementName>
-<elementValue>
<value>-99.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>H_24R</elementName>
-<elementValue>
<value>0.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15M</elementName>
-<elementValue>
<value>3.7</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WD15M</elementName>
-<elementValue>
<value>98</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15T</elementName>
-<elementValue>
<value>1722</value>
</elementValue>
</weatherElement>
-<parameter>
<parameterName>CITY</parameterName>
<parameterValue>桃園市</parameterValue>
</parameter>
-<parameter>
<parameterName>CITY_SN</parameterName>
<parameterValue>08</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN</parameterName>
<parameterValue>桃園區</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN_SN</parameterName>
<parameterValue>042</parameterValue>
</parameter>
</location>
-<location>
<lat>24.7108</lat>
<lon>120.8808</lon>
<locationName>竹南</locationName>
<stationId>C0E420</stationId>
-<time>
<obsTime>2016-04-16T17:30:00+08:00</obsTime>
</time>
-<weatherElement>
<elementName>ELEV</elementName>
-<elementValue>
<value>19.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDIR</elementName>
-<elementValue>
<value>250.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDSD</elementName>
-<elementValue>
<value>1.7</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>TEMP</elementName>
-<elementValue>
<value>29.5</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>HUMD</elementName>
-<elementValue>
<value>0.60</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>PRES</elementName>
-<elementValue>
<value>1004.2</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>SUN</elementName>
-<elementValue>
<value>-99.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>H_24R</elementName>
-<elementValue>
<value>0.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15M</elementName>
-<elementValue>
<value>4.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WD15M</elementName>
-<elementValue>
<value>190</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15T</elementName>
-<elementValue>
<value>1725</value>
</elementValue>
</weatherElement>
-<parameter>
<parameterName>CITY</parameterName>
<parameterValue>苗栗縣</parameterValue>
</parameter>
-<parameter>
<parameterName>CITY_SN</parameterName>
<parameterValue>11</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN</parameterName>
<parameterValue>竹南鎮</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN_SN</parameterName>
<parameterValue>079</parameterValue>
</parameter>
</location>
-<location>
<lat>24.6032</lat>
<lon>120.9921</lon>
<locationName>南庄</locationName>
<stationId>C0E430</stationId>
-<time>
<obsTime>2016-04-16T17:30:00+08:00</obsTime>
</time>
-<weatherElement>
<elementName>ELEV</elementName>
-<elementValue>
<value>258.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDIR</elementName>
-<elementValue>
<value>65.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDSD</elementName>
-<elementValue>
<value>1.5</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>TEMP</elementName>
-<elementValue>
<value>29.9</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>HUMD</elementName>
-<elementValue>
<value>0.49</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>PRES</elementName>
-<elementValue>
<value>981.9</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>SUN</elementName>
-<elementValue>
<value>-99.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>H_24R</elementName>
-<elementValue>
<value>1.5</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15M</elementName>
-<elementValue>
<value>6.2</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WD15M</elementName>
-<elementValue>
<value>51</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15T</elementName>
-<elementValue>
<value>1730</value>
</elementValue>
</weatherElement>
-<parameter>
<parameterName>CITY</parameterName>
<parameterValue>苗栗縣</parameterValue>
</parameter>
-<parameter>
<parameterName>CITY_SN</parameterName>
<parameterValue>11</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN</parameterName>
<parameterValue>南庄鄉</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN_SN</parameterName>
<parameterValue>092</parameterValue>
</parameter>
</location>
-<location>
<lat>24.4128</lat>
<lon>120.7578</lon>
<locationName>三義</locationName>
<stationId>C0E530</stationId>
-<time>
<obsTime>2016-04-16T17:30:00+08:00</obsTime>
</time>
-<weatherElement>
<elementName>ELEV</elementName>
-<elementValue>
<value>341.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDIR</elementName>
-<elementValue>
<value>203.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDSD</elementName>
-<elementValue>
<value>3.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>TEMP</elementName>
-<elementValue>
<value>27.4</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>HUMD</elementName>
-<elementValue>
<value>0.62</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>PRES</elementName>
-<elementValue>
<value>971.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>SUN</elementName>
-<elementValue>
<value>-99.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>H_24R</elementName>
-<elementValue>
<value>0.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15M</elementName>
-<elementValue>
<value>6.7</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WD15M</elementName>
-<elementValue>
<value>212</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WS15T</elementName>
-<elementValue>
<value>1729</value>
</elementValue>
</weatherElement>
-<parameter>
<parameterName>CITY</parameterName>
<parameterValue>苗栗縣</parameterValue>
</parameter>
-<parameter>
<parameterName>CITY_SN</parameterName>
<parameterValue>11</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN</parameterName>
<parameterValue>三義鄉</parameterValue>
</parameter>
-<parameter>
<parameterName>TOWN_SN</parameterName>
<parameterValue>106</parameterValue>
</parameter>
</location>
-<location>
<lat>24.3499</lat>
<lon>120.6324</lon>
<locationName>大甲</locationName>
<stationId>C0F930</stationId>
-<time>
<obsTime>2016-04-16T17:30:00+08:00</obsTime>
</time>
-<weatherElement>
<elementName>ELEV</elementName>
-<elementValue>
<value>100.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDIR</elementName>
-<elementValue>
<value>196.0</value>
</elementValue>
</weatherElement>
-<weatherElement>
<elementName>WDSD</elementName>
</cwbopendata>
Last edited: