<include> and xml line formatting and possibly tabs error
#1
Why is this accepted by the skinning engine ? :

Code:
                    <include condition="Skin.HasSetting(context.trailer) + !String.IsEmpty(ListItem.Trailer)" file="bespoke_Includes_Buttons.xml">movieinformation_TrailerButton</include>

And why is this not ? :

Code:
                    <include condition="Skin.HasSetting(context.trailer) + !String.IsEmpty(ListItem.Trailer)" file="Includes_Buttons.xml">
                        movieinformation_TestButton
                    </include>

The button is not added to the screen, and I see this error message in Kodi's logfile :

Code:
16:57:42.328 T:140370368546880 WARNING: Skin has invalid include:
                                                                    movieinformation_TestButton
The only difference being that I hit the Return-key twice to add the line breaks.

In the failing format, there are leading tabs before movieinformation_TrailerButton.
In both formats there are leading tabs before <include> and </include>.

When I roll back to the one-liner, the warning message doesn't appear in the log and the new button is added to the screen.
Reply
#2
You've answered your own question!
Reply
#3
Hhmmmm?! :rolleys: Not very nice of the skinning engine.

Leading tabs before the include's name can't/won't be skipped ?
or
Leading tabs in an include's name are allowed ?

EDIT:
Just for fun, I checked if leading tabs in the include's name are allowed.
In file Includes_Buttons.xml :

Code:
<include name="                        movieinformation_TestButton">

And of course it wasn't allowed. Would quickly become a liability anyway.
Not stripping leading tabs is on par though.
Reply

Logout Mark Read Team Forum Stats Members Help
<include> and xml line formatting and possibly tabs error0