How do I set variables in XML?
#1
I'm making a kodi addon and I'm wondering if there is a way to declare a variable in the XML for redundant information.  Below is a very simple example.  The two images have a width of 828.  Is there a way to set this width value in one place so I don't have to make changes all over the code?  Thanks.
Quote:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<window>

    <coordinates>
        <system>1</system>
        <posx>120</posx>
        <posy>70</posy>
    </coordinates>

    <controls>
        <!--background image-->
        <control type="image">
            <width>828</width>
            <height>600</height>
            <texture>image.png</texture>
        </control>

        <!--background overlay-->
        <control type="image">
            <width>828</width>
            <height>585</height>
            <texture>image2.png</texture>
        </control>

    </controls>
</window>
Reply
#2
nope, you can't... at least not in your xml file.
what is possible, is to set the width of the images in your python code.
https://codedocs.xyz/xbmc/xbmc/group__py...ba5cf6f9b7
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
How do I set variables in XML?0