How to get the maximum attribute from a serie of nodes

Tags: #<Tag:0x00007f616a18da30>

I am writing some custom code for my openhabian. I have achieved getting data from the api in XML. But how can I select the maximum attribute of a series of nodes using xpath? I am trying to get the maximum value of value which is an attribute I find under time/location/precipitation/value

I have gone through both the documentation: https://www.w3.org/TR/xpath-functions-31/#func-maxand looked through similar questions on stackoverflow.

My XML

<weatherdata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://api.met.no/weatherapi/locationforecast/1.9/schema" created="2019-04-02T12:11:29Z">
<meta>
<model name="LOCAL" termin="2019-04-02T06:00:00Z" runended="2019-04-02T08:27:40Z" nextrun="2019-04-02T16:00:00Z" from="2019-04-02T13:00:00Z" to="2019-04-05T00:00:00Z"/>
<model name="EPS" termin="2019-04-02T00:00:00Z" runended="2019-04-02T09:15:12Z" nextrun="2019-04-02T22:00:00Z" from="2019-04-05T06:00:00Z" to="2019-04-11T18:00:00Z"/>
</meta>
<product class="pointData">
<time datatype="forecast" from="2019-04-02T13:00:00Z" to="2019-04-02T13:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="8.6"/>
<windDirection id="dd" deg="103.8" name="E"/>
<windSpeed id="ff" mps="6.2" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="10.6"/>
<areaMaxWindSpeed mps="9.6"/>
<humidity value="58.4" unit="percent"/>
<pressure id="pr" unit="hPa" value="1010.6"/>
<cloudiness id="NN" percent="0.1"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.1"/>
<mediumClouds id="MEDIUM" percent="0.0"/>
<highClouds id="HIGH" percent="0.0"/>
<dewpointTemperature id="TD" unit="celsius" value="0.7"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T12:00:00Z" to="2019-04-02T13:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T11:00:00Z" to="2019-04-02T13:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T10:00:00Z" to="2019-04-02T13:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T07:00:00Z" to="2019-04-02T13:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.0"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T14:00:00Z" to="2019-04-02T14:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="8.6"/>
<windDirection id="dd" deg="99.9" name="E"/>
<windSpeed id="ff" mps="6.6" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="11.1"/>
<areaMaxWindSpeed mps="10.6"/>
<humidity value="60.8" unit="percent"/>
<pressure id="pr" unit="hPa" value="1010.0"/>
<cloudiness id="NN" percent="8.8"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.0"/>
<mediumClouds id="MEDIUM" percent="0.0"/>
<highClouds id="HIGH" percent="8.8"/>
<dewpointTemperature id="TD" unit="celsius" value="1.3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T13:00:00Z" to="2019-04-02T14:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T12:00:00Z" to="2019-04-02T14:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T11:00:00Z" to="2019-04-02T14:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T08:00:00Z" to="2019-04-02T14:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.6"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T15:00:00Z" to="2019-04-02T15:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="8.4"/>
<windDirection id="dd" deg="95.7" name="E"/>
<windSpeed id="ff" mps="6.6" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="11.2"/>
<areaMaxWindSpeed mps="11.0"/>
<humidity value="61.4" unit="percent"/>
<pressure id="pr" unit="hPa" value="1009.4"/>
<cloudiness id="NN" percent="67.8"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.0"/>
<mediumClouds id="MEDIUM" percent="0.3"/>
<highClouds id="HIGH" percent="67.7"/>
<dewpointTemperature id="TD" unit="celsius" value="1.3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T14:00:00Z" to="2019-04-02T15:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T13:00:00Z" to="2019-04-02T15:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T12:00:00Z" to="2019-04-02T15:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T09:00:00Z" to="2019-04-02T15:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="6.3"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T16:00:00Z" to="2019-04-02T16:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="8.1"/>
<windDirection id="dd" deg="91.3" name="E"/>
<windSpeed id="ff" mps="6.3" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="11.0"/>
<areaMaxWindSpeed mps="10.9"/>
<humidity value="63.5" unit="percent"/>
<pressure id="pr" unit="hPa" value="1008.7"/>
<cloudiness id="NN" percent="53.5"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.0"/>
<mediumClouds id="MEDIUM" percent="1.1"/>
<highClouds id="HIGH" percent="52.9"/>
<dewpointTemperature id="TD" unit="celsius" value="1.5"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T15:00:00Z" to="2019-04-02T16:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T14:00:00Z" to="2019-04-02T16:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T13:00:00Z" to="2019-04-02T16:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T10:00:00Z" to="2019-04-02T16:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="6.7"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T17:00:00Z" to="2019-04-02T17:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="7.8"/>
<windDirection id="dd" deg="88.9" name="E"/>
<windSpeed id="ff" mps="5.8" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="10.3"/>
<areaMaxWindSpeed mps="10.5"/>
<humidity value="65.2" unit="percent"/>
<pressure id="pr" unit="hPa" value="1008.5"/>
<cloudiness id="NN" percent="31.8"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.0"/>
<mediumClouds id="MEDIUM" percent="1.2"/>
<highClouds id="HIGH" percent="30.9"/>
<dewpointTemperature id="TD" unit="celsius" value="1.5"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T16:00:00Z" to="2019-04-02T17:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T15:00:00Z" to="2019-04-02T17:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T14:00:00Z" to="2019-04-02T17:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T11:00:00Z" to="2019-04-02T17:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="7.8"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T18:00:00Z" to="2019-04-02T18:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="7.0"/>
<windDirection id="dd" deg="78.8" name="E"/>
<windSpeed id="ff" mps="4.4" beaufort="3" name="Lett bris"/>
<windGust id="ff_gust" mps="9.1"/>
<areaMaxWindSpeed mps="10.2"/>
<humidity value="68.9" unit="percent"/>
<pressure id="pr" unit="hPa" value="1008.3"/>
<cloudiness id="NN" percent="37.7"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.7"/>
<mediumClouds id="MEDIUM" percent="0.3"/>
<highClouds id="HIGH" percent="37.2"/>
<temperatureProbability unit="probabilitycode" value="0"/>
<windProbability unit="probabilitycode" value="0"/>
<dewpointTemperature id="TD" unit="celsius" value="1.5"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T17:00:00Z" to="2019-04-02T18:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T16:00:00Z" to="2019-04-02T18:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T15:00:00Z" to="2019-04-02T18:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T12:00:00Z" to="2019-04-02T18:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="7.0"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="LightCloud" number="2"/>
<symbolProbability unit="probabilitycode" value="0"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T19:00:00Z" to="2019-04-02T19:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="6.2"/>
<windDirection id="dd" deg="68.1" name="E"/>
<windSpeed id="ff" mps="3.9" beaufort="3" name="Lett bris"/>
<windGust id="ff_gust" mps="7.1"/>
<areaMaxWindSpeed mps="9.8"/>
<humidity value="70.8" unit="percent"/>
<pressure id="pr" unit="hPa" value="1008.3"/>
<cloudiness id="NN" percent="89.8"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="30.4"/>
<mediumClouds id="MEDIUM" percent="14.5"/>
<highClouds id="HIGH" percent="87.4"/>
<dewpointTemperature id="TD" unit="celsius" value="1.1"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T18:00:00Z" to="2019-04-02T19:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T17:00:00Z" to="2019-04-02T19:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T16:00:00Z" to="2019-04-02T19:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T13:00:00Z" to="2019-04-02T19:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="6.2"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T20:00:00Z" to="2019-04-02T20:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="6.3"/>
<windDirection id="dd" deg="71.7" name="E"/>
<windSpeed id="ff" mps="4.4" beaufort="3" name="Lett bris"/>
<windGust id="ff_gust" mps="7.2"/>
<areaMaxWindSpeed mps="9.9"/>
<humidity value="66.9" unit="percent"/>
<pressure id="pr" unit="hPa" value="1008.0"/>
<cloudiness id="NN" percent="99.2"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="53.3"/>
<mediumClouds id="MEDIUM" percent="45.8"/>
<highClouds id="HIGH" percent="96.6"/>
<dewpointTemperature id="TD" unit="celsius" value="0.4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T19:00:00Z" to="2019-04-02T20:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T18:00:00Z" to="2019-04-02T20:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T17:00:00Z" to="2019-04-02T20:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T14:00:00Z" to="2019-04-02T20:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="6.2"/>
<maxTemperature id="TTT" unit="celsius" value="8.6"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T21:00:00Z" to="2019-04-02T21:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="6.0"/>
<windDirection id="dd" deg="67.3" name="NE"/>
<windSpeed id="ff" mps="4.8" beaufort="3" name="Lett bris"/>
<windGust id="ff_gust" mps="7.9"/>
<areaMaxWindSpeed mps="10.2"/>
<humidity value="69.7" unit="percent"/>
<pressure id="pr" unit="hPa" value="1007.8"/>
<cloudiness id="NN" percent="99.6"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="57.5"/>
<mediumClouds id="MEDIUM" percent="84.6"/>
<highClouds id="HIGH" percent="89.3"/>
<dewpointTemperature id="TD" unit="celsius" value="0.7"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T20:00:00Z" to="2019-04-02T21:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T19:00:00Z" to="2019-04-02T21:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T18:00:00Z" to="2019-04-02T21:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T15:00:00Z" to="2019-04-02T21:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="6.0"/>
<maxTemperature id="TTT" unit="celsius" value="8.4"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T22:00:00Z" to="2019-04-02T22:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="5.9"/>
<windDirection id="dd" deg="66.2" name="NE"/>
<windSpeed id="ff" mps="5.4" beaufort="3" name="Lett bris"/>
<windGust id="ff_gust" mps="8.8"/>
<areaMaxWindSpeed mps="11.2"/>
<humidity value="68.7" unit="percent"/>
<pressure id="pr" unit="hPa" value="1007.3"/>
<cloudiness id="NN" percent="100.0"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="57.8"/>
<mediumClouds id="MEDIUM" percent="99.8"/>
<highClouds id="HIGH" percent="76.5"/>
<dewpointTemperature id="TD" unit="celsius" value="0.4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T21:00:00Z" to="2019-04-02T22:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T20:00:00Z" to="2019-04-02T22:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T19:00:00Z" to="2019-04-02T22:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T16:00:00Z" to="2019-04-02T22:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.9"/>
<maxTemperature id="TTT" unit="celsius" value="8.1"/>
<symbol id="PartlyCloud" number="3"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T23:00:00Z" to="2019-04-02T23:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="5.9"/>
<windDirection id="dd" deg="64.4" name="NE"/>
<windSpeed id="ff" mps="6.1" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="10.1"/>
<areaMaxWindSpeed mps="13.2"/>
<humidity value="66.6" unit="percent"/>
<pressure id="pr" unit="hPa" value="1006.7"/>
<cloudiness id="NN" percent="99.5"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="54.0"/>
<mediumClouds id="MEDIUM" percent="98.6"/>
<highClouds id="HIGH" percent="35.6"/>
<dewpointTemperature id="TD" unit="celsius" value="-0.0"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T22:00:00Z" to="2019-04-02T23:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T21:00:00Z" to="2019-04-02T23:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T20:00:00Z" to="2019-04-02T23:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T17:00:00Z" to="2019-04-02T23:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.9"/>
<maxTemperature id="TTT" unit="celsius" value="7.8"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-03T00:00:00Z" to="2019-04-03T00:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="5.7"/>
<windDirection id="dd" deg="60.0" name="NE"/>
<windSpeed id="ff" mps="6.0" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="10.1"/>
<areaMaxWindSpeed mps="14.0"/>
<humidity value="65.6" unit="percent"/>
<pressure id="pr" unit="hPa" value="1006.1"/>
<cloudiness id="NN" percent="97.3"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="9.1"/>
<mediumClouds id="MEDIUM" percent="89.2"/>
<highClouds id="HIGH" percent="69.0"/>
<temperatureProbability unit="probabilitycode" value="0"/>
<windProbability unit="probabilitycode" value="0"/>
<dewpointTemperature id="TD" unit="celsius" value="-0.4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T23:00:00Z" to="2019-04-03T00:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T22:00:00Z" to="2019-04-03T00:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T21:00:00Z" to="2019-04-03T00:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T18:00:00Z" to="2019-04-03T00:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.7"/>
<maxTemperature id="TTT" unit="celsius" value="7.0"/>
<symbol id="Cloud" number="4"/>
<symbolProbability unit="probabilitycode" value="0"/>
</location>
</time>
<time datatype="forecast" from="2019-04-03T01:00:00Z" to="2019-04-03T01:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<temperature id="TTT" unit="celsius" value="5.3"/>
<windDirection id="dd" deg="58.9" name="NE"/>
<windSpeed id="ff" mps="6.4" beaufort="4" name="Laber bris"/>
<windGust id="ff_gust" mps="10.6"/>
<areaMaxWindSpeed mps="14.7"/>
<humidity value="67.1" unit="percent"/>
<pressure id="pr" unit="hPa" value="1005.5"/>
<cloudiness id="NN" percent="100.0"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="12.9"/>
<mediumClouds id="MEDIUM" percent="62.8"/>
<highClouds id="HIGH" percent="99.7"/>
<dewpointTemperature id="TD" unit="celsius" value="-0.5"/>
</location>
</time>
<time datatype="forecast" from="2019-04-03T00:00:00Z" to="2019-04-03T01:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T23:00:00Z" to="2019-04-03T01:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T22:00:00Z" to="2019-04-03T01:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
<time datatype="forecast" from="2019-04-02T19:00:00Z" to="2019-04-03T01:00:00Z">
<location altitude="7" latitude="58.1461" longitude="7.9957">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<minTemperature id="TTT" unit="celsius" value="5.3"/>
<maxTemperature id="TTT" unit="celsius" value="6.3"/>
<symbol id="Cloud" number="4"/>
</location>
</time>
...

my xpath try:
//time/location/precipitation[@value= max(…/precipitation/@value)]/@value

I wanted to get the maximum value, but instead I get all values.
(See here for example: http://xpather.com/6I4dKpnj)

You will have a much better chance of getting an answer on an XML forum or StackOverflow or the like. Most OH users use JSON when possible and very few of us have a lot of XML experience (or are willing to admit to it).

1 Like

Is that by a reason? Are XML less flexible?

XML is very verbose and not as easy to work with in most cases.

If you know XML, by all means use it. But you will need to ask an XML specific question like this on an XML forum.