Need help with XML value to item

Hello!

i’m trying to get values from an XML
url into a Number Item. Without any success.
Would really appreciate some help :slightly_smiling:

My item:

Number SpotPris “Spotpris [%.1f sek/mwh]” (kwh) { http="<[http://datafeed.expektra.se/datafeed.svc/spotprice?bidding_area=sys&format=xml&u=c:3000:XSLT(elpris.xsl)]" }

Tranform

<?xml version="1.0"?>

<xsl:stylesheet
xmlns:xsl=“http://www.w3.org/1999/XSL/Transform

<xsl:output indent=“yes” method=“xml” encoding=“UTF-8” omit-xml-declaration=“yes” />

<xsl:template match="/">
<xsl:value-of select="//data/@value" />
</xsl:template>

</xsl:stylesheet>

When I change my item to a String and formating to [%s] the Item shows all the values from XML.
Seems like my transformation doesn’t work.

I am not very familiar with xls transform but a quick google brought up the [last()] command.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output indent="yes" method="xml" encoding="UTF-8" omit-xml-declaration="yes" />

<xsl:template match="/">
	<xsl:value-of select="(//data/value)[last()]"/>
</xsl:template>
</xsl:stylesheet>

last edit this works
created and tested at http://www.utilities-online.info/xsltransformation/

Thank you! Works perfect :smile: