mb_language("uni"); mb_internal_encoding("utf-8"); mb_http_input("auto"); mb_http_output("utf-8"); ?>
/ND/weather-data[@prefecture="osaka"]/weather[@date="2012-01-04"]
/ND/weather-data[@prefecture="osaka"]/weather/@date
root(/ND/weather-data[@prefecture="tokyo"])
/ND/weather-data[@prefecture="tokyo"]
/ND/weather-data[@prefecture="osaka"]/weather[@date="2012-01-02"] {-- 日付は任意 --}
<weather date='2012-01-04' hour='15'> <condition>曇</condition> <pressure_hpa>1001.4</pressure_hpa> <rainfall_mm>--</rainfall_mm> <temperature_c>6.0</temperature_c> <humidity>38</humidity> <wind><speed_ms>10.1</speed_ms><direction>西北西</direction></wind> </weather>
/ND/weather-data[@prefecture="osaka"]/weather/@date
{-- 6回検索ヒットするので6回挿入されてしまう --} /ND/weather-data[@prefecture="osaka"]/weather
<weather date='2012-01-04' hour='15'> <condition>曇</condition> <pressure_hpa>1001.4</pressure_hpa> <rainfall_mm>--</rainfall_mm> <temperature_c>6.0</temperature_c> <humidity>38</humidity> <wind><speed_ms>10.1</speed_ms><direction>西北西</direction></wind> </weather>
/ND/weather-data/weather/rainfall_mm[text()="--"]
<rainfall_mm>なし</rainfall_mm>
/ND/weather-data/weather/rainfall_mm
▲このページのTOPへ