Slice tag issue

Topics related to the iOS and/or Apple Watch app.
Post Reply
typiak84
Posts: 1
Joined: Wed Feb 14, 2018 11:31 pm

Slice tag issue

Post by typiak84 » Thu Feb 15, 2018 12:17 am

Hello.

Here is my Denon Receiver Xml feedback:


<?xml version="1.0" encoding="utf-8" ?>
<item>
<FriendlyName><value>DENON AVR-3313</value></FriendlyName>
<Power><value>ON</value></Power>
<ZonePower><value>ON</value></ZonePower>
<RenameZone><value>MAIN ZONE
</value></RenameZone>
<TopMenuLink><value>OFF</value></TopMenuLink>
<ModelId><value>6</value></ModelId>
<SalesArea><value>1</value></SalesArea>
<InputFuncSelect><value>TV AUDIO</value></InputFuncSelect>
<NetFuncSelect><value>RHAPSODY</value></NetFuncSelect>
<selectSurround><value>DTS NEO:6 cinema </value></selectSurround>
<VolumeDisplay><value>Relative</value></VolumeDisplay>
<MasterVolume><value>-20.0</value></MasterVolume>
<Mute><value>off</value></Mute>
<RemoteMaintenance><value>OFF</value></RemoteMaintenance>
<SubwooferDisplay><value>FALSE</value></SubwooferDisplay>
<Zone2VolDisp><value>TRUE</value></Zone2VolDisp>
<LastfmDisplay><value>FALSE</value></LastfmDisplay>
<SpotifyEnable><value>TRUE</value></SpotifyEnable>
</item>


The goal of my scrip is to use the slice function to parse this feedback to extract the value between "<Power><value>" and "</value></Power>" and put it in a global variable called "DenonAVRPowerState"

Here is the script i try to use:
[slice]<Power><value>[:]</value></Power>[;]
_global.DenonAVRPowerState = _feedback;

And here is the error script message i got whith this script:
Javascript Error!
Button: "STATUS QUERY Power" - Feedback script
SyntaxError: Unexpected token ":" (line 1)


Could you explain me where is my syntax error please ?
Kind regards.

Post Reply