Hallo openHab-Mitstreiter,
ich habe seit heute ein Miele@Home-Gerät und möchte dies gerne mittels HTTP-Binding und XSLT-Übersetzung anbinden. Dies klappt auch prinzipiell. Allerdings brauche ich in meiner Bedingung für einige Tags auch Umlaute und hier klappt es dann nicht mehr! Ich habe Versucht den Wert erst als Variable zu speichern und dann den Test gegen die Variable durchzuführen und ein HTML-Escape (ä=ä ) führte auch nicht zum Erfolg.
Kann mir bitte jemand einen Tipp geben, wie ich Umlaute escapen muss:
Nicht funktioniert:
Funktioniert:
Antwort des Gateways:
Viele Grüße,
Dirk
ich habe seit heute ein Miele@Home-Gerät und möchte dies gerne mittels HTTP-Binding und XSLT-Übersetzung anbinden. Dies klappt auch prinzipiell. Allerdings brauche ich in meiner Bedingung für einige Tags auch Umlaute und hier klappt es dann nicht mehr! Ich habe Versucht den Wert erst als Variable zu speichern und dann den Test gegen die Variable durchzuführen und ein HTML-Escape (ä=ä ) führte auch nicht zum Erfolg.
Kann mir bitte jemand einen Tipp geben, wie ich Umlaute escapen muss:
Nicht funktioniert:
Code:
[I]<?[/I][COLOR=#0000ff][B]xml version[/B][/COLOR][COLOR=#008000][B]="1.0" [/B][/COLOR][COLOR=#0000ff][B]encoding[/B][/COLOR][COLOR=#008000][B]="utf-8" [/B][/COLOR][I]?> [/I]<[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:stylesheet [/B][/COLOR][COLOR=#0000ff][B]version[/B][/COLOR][COLOR=#008000][B]="1.0" [/B][/COLOR][COLOR=#0000ff][B]xmlns:[/B][/COLOR][COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#008000][B]="http://www.w3.org/1999/XSL/Transform"[/B][/COLOR]> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:output [/B][/COLOR][COLOR=#0000ff][B]indent[/B][/COLOR][COLOR=#008000][B]="yes" [/B][/COLOR][COLOR=#0000ff][B]method[/B][/COLOR][COLOR=#008000][B]="xml" [/B][/COLOR][COLOR=#0000ff][B]encoding[/B][/COLOR][COLOR=#008000][B]="UTF-8" [/B][/COLOR][COLOR=#0000ff][B]omit-xml-declaration[/B][/COLOR][COLOR=#008000][B]="yes"[/B][/COLOR]/> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:variable [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="geraet"[/B][/COLOR]>Gerät</[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:variable[/B][/COLOR]> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:template [/B][/COLOR][COLOR=#0000ff][B]match[/B][/COLOR][COLOR=#008000][B]="device/information/key"[/B][/COLOR]> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:if [/B][/COLOR][COLOR=#0000ff][B]test[/B][/COLOR][COLOR=#008000][B]="@name='[/B][/COLOR][COLOR=#008000][B]Gerät'"[/B][/COLOR]> <!-- klappt nicht --> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:value-of [/B][/COLOR][COLOR=#0000ff][B]select[/B][/COLOR][COLOR=#008000][B]="@value"[/B][/COLOR]/> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:if[/B][/COLOR]> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:template[/B][/COLOR]> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:stylesheet[/B][/COLOR]>
Code:
[I]<?[/I][COLOR=#0000ff][B]xml version[/B][/COLOR][COLOR=#008000][B]="1.0" [/B][/COLOR][COLOR=#0000ff][B]encoding[/B][/COLOR][COLOR=#008000][B]="utf-8" [/B][/COLOR][I]?> [/I]<[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:stylesheet [/B][/COLOR][COLOR=#0000ff][B]version[/B][/COLOR][COLOR=#008000][B]="1.0" [/B][/COLOR][COLOR=#0000ff][B]xmlns:[/B][/COLOR][COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#008000][B]="http://www.w3.org/1999/XSL/Transform"[/B][/COLOR]> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:output [/B][/COLOR][COLOR=#0000ff][B]indent[/B][/COLOR][COLOR=#008000][B]="yes" [/B][/COLOR][COLOR=#0000ff][B]method[/B][/COLOR][COLOR=#008000][B]="xml" [/B][/COLOR][COLOR=#0000ff][B]encoding[/B][/COLOR][COLOR=#008000][B]="UTF-8" [/B][/COLOR][COLOR=#0000ff][B]omit-xml-declaration[/B][/COLOR][COLOR=#008000][B]="yes"[/B][/COLOR]/> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:template [/B][/COLOR][COLOR=#0000ff][B]match[/B][/COLOR][COLOR=#008000][B]="device/information/key"[/B][/COLOR]> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:if [/B][/COLOR][COLOR=#0000ff][B]test[/B][/COLOR][COLOR=#008000][B]="@name='Dauer'"[/B][/COLOR]> <!-- funktioniert! --> <[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:value-of [/B][/COLOR][COLOR=#0000ff][B]select[/B][/COLOR][COLOR=#008000][B]="@value"[/B][/COLOR]/> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:if[/B][/COLOR]> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:template[/B][/COLOR]> </[COLOR=#660e7a][B]xsl[/B][/COLOR][COLOR=#000080][B]:stylesheet[/B][/COLOR]>
Code:
[I]<?[/I][COLOR=#0000ff][B]xml version[/B][/COLOR][COLOR=#008000][B]="1.0" [/B][/COLOR][COLOR=#0000ff][B]encoding[/B][/COLOR][COLOR=#008000][B]="UTF-8"[/B][/COLOR][I]?> [/I]<[COLOR=#000080][B]device[/B][/COLOR]> <[COLOR=#000080][B]information[/B][/COLOR]> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Gerät" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="Backofen"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Gerätestatus" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="Aus"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Programm" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="0"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Phase" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="0"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="measuredTemperature" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="32768"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="deviceTemperature2" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]=""[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Startzeit" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="0"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Dauer" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="0"[/B][/COLOR]/> <[COLOR=#000080][B]key [/B][/COLOR][COLOR=#0000ff][B]name[/B][/COLOR][COLOR=#008000][B]="Endzeit" [/B][/COLOR][COLOR=#0000ff][B]value[/B][/COLOR][COLOR=#008000][B]="0"[/B][/COLOR]/> </[COLOR=#000080][B]information[/B][/COLOR]> <[COLOR=#000080][B]actions[/B][/COLOR]></[COLOR=#000080][B]actions[/B][/COLOR]> </[COLOR=#000080][B]device[/B][/COLOR]>
Dirk
Kommentar