XML-bug? (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    In myvideoFilmstripView.xml (line 191 -> 202) contains som disallowed XML, I think:

    Code:
        <control>
          <type>textbox</type>
          <label>#mpaarating</label>
          <posX>410</posX>
          <posY>365</posY>
          <width>400</width>
          <height>50</height>
          <font>mediastream10</font>
          <visible><![CDATA[facadeview.filmstrip+control.isvisible(4441)+!string.starts(#mpaarating,<)+!string.starts(#mpaarating,unknown)]]></visible>
          <animation effect="fade" time="250">WindowOpen</animation>
          <animation effect="fade" time="250">WindowClose</animation>
        </control>

    This results in the following error in my log:

    Code:
    2011-10-30 22:43:28.115714 [ERROR][MPMain(1)]: GUIWindow:OnWindowLoaded 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\StreamedMP\HeadWeb.xml' control id:4 ex:Et objekt af typen 'MediaPortal.GUI.Library.GUITextControl' kan ikke konverteres til typen 'MediaPortal.GUI.Library.GUIButtonControl'.    ved System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
       ved System.Reflection.RtFieldInfo.InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, Boolean doVisibilityCheck, Boolean doCheckConsistency)
       ved System.Reflection.RtFieldInfo.InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, Boolean doVisibilityCheck)
       ved System.Reflection.RtFieldInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
       ved MediaPortal.GUI.Library.GUIWindow.OnWindowLoaded() HeadWeb.HeadWeb

    Fixed by removing the <![CDATA stuff in the visible-condition:

    Code:
        <control>
          <type>textbox</type>
          <label>#mpaarating</label>
          <posX>410</posX>
          <posY>365</posY>
          <width>400</width>
          <height>50</height>
          <font>mediastream10</font>
          <visible>facadeview.filmstrip+control.isvisible(4441)+!string.starts(#mpaarating,<)+!string.starts(#mpaarating,unknown)></visible>
          <animation effect="fade" time="250">WindowOpen</animation>
          <animation effect="fade" time="250">WindowClose</animation>
        </control>

    This is with the latest version of the skin installed.

    :D
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    Strange, the whole point of the CDATA structure was to allow the literal condition for '<'

    Im surprised it works without it, will have to take another look.

    Your log entry is complaining about HeadWeb.xml, inparticular a button control.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #3
    Yes, the extension using HeadWeb.xml is this new plugin I'm doing:
    MEDIAPORTAL - HeadWeb

    The plugin just has a hidden menu like any other plugin with menu-buttons:

    Code:
    <control>
    	<type>actiongroup</type>
    	<description>action menu</description>
    	<defaultcontrol>2</defaultcontrol>
    	<onexit>50</onexit>
    	<buttonX>1232</buttonX>
    	<buttonY>50</buttonY>
    	<buttonwidth>48</buttonwidth>
    	<buttonheight>144</buttonheight>
    	<textureFocus>#StreamedMP.ActionMenu.Image</textureFocus>
    	<textureNoFocus>#StreamedMP.ActionMenu.Image</textureNoFocus>
    	<dimColor>00ffffff</dimColor>
    	
    	<control>
    		<type>image</type>
    		<posX>1002</posX>
    		<posY>0</posY>
    		<width>278</width>
    		<height>720</height>
    		<texture>hiddenmenu_right.png</texture>
    		<visible>!Control.HasFocus(50)</visible>
    		<animation effect="slide" time="100" start="300,0">visible</animation>
    		<animation effect="slide" time="0" end="300,0">hidden</animation>
    	</control>
    	
    	<control>
    		<id>0</id>
    		<description>Dummy Button (for Mouse)</description>
    		<label>-</label>
    		<type>button</type>
    		<posX>1002</posX>
    		<posY>0</posY>
    		<width>278</width>
    		<height>720</height>
    		<visible>!Control.HasFocus(50)</visible>
    		<animation effect="slide" time="100" start="300,0">visible</animation>
    		<animation effect="slide" time="0" end="300,0">hidden</animation>
    	</control>
    	
    	<control>
    		<description>View Options</description>
    		<id>0</id>
    		<label>499</label>
    		<type>label</type>
    		<font>mediastream12tc</font>
    		<posX>1040</posX>
    		<posY>225</posY>
    		<visible>!Control.HasFocus(50)</visible>
    		<animation effect="slide" time="100" start="300,0">visible</animation>
    		<animation effect="slide" time="0" end="300,0">hidden</animation>
    	</control>
    	
    	<control>
    		<type>group</type>
    		<description>group element</description>
    		<visible>!Control.HasFocus(50)</visible>
    		<animation effect="slide" time="100" start="300,0">visible</animation>
    		<animation effect="slide" time="0" end="300,0">hidden</animation>
    		<posX>1040</posX>
    		<posY>250</posY>
    		<width>220</width>
    		<height>720</height>
    		<layout>StackLayout(0, Vertical, true)</layout>
    		
    		<control>
    			<description>Layout</description>
    			<type>button</type>
    			<id>2</id>
    			<label>Layout</label>
    			<onleft>50</onleft>
    			<onright>2</onright>
    			<onup>17</onup>
    			<ondown>3</ondown>
    		</control>
    		
    		<control>
    			<description>Best sellers</description>
    			<type>button</type>
    			<id>3</id>
    			<label>Best sellers</label>
    			<onleft>50</onleft>
    			<onright>3</onright>
    			<onup>2</onup>
    			<ondown>4</ondown>
    		</control>
    		
    		<control>
    			<description>Newest</description>
    			<type>button</type>
    			<id>4</id>
    			<label>Newest</label>
    			<onleft>50</onleft>
    			<onright>4</onright>
    			<onup>3</onup>
    			<ondown>5</ondown>
    		</control>
    		
    		<control>
    			<description>Genres</description>
    			<type>button</type>
    			<id>5</id>
    			<label>Genres</label>
    			<onleft>50</onleft>
    			<onright>5</onright>
    			<onup>4</onup>
    			<ondown>6</ondown>
    		</control>
    		
    		<control>
    			<description>Search</description>
    			<type>button</type>
    			<id>6</id>
    			<label>Search</label>
    			<onleft>50</onleft>
    			<onright>6</onright>
    			<onup>5</onup>
    			<ondown>7</ondown>
    		</control>
    		
    		<control>
    			<description>My rentals</description>
    			<type>button</type>
    			<id>7</id>
    			<label>My rentals</label>
    			<onleft>50</onleft>
    			<onright>7</onright>
    			<onup>6</onup>
    			<ondown>8</ondown>
    		</control>
    		
    		<control>
    			<description>Favorites</description>
    			<type>button</type>
    			<id>8</id>
    			<label>Favorites</label>
    			<onleft>50</onleft>
    			<onright>8</onright>
    			<onup>7</onup>
    			<ondown>9</ondown>
    		</control>
    		
    		<control>
    			<description>Log out</description>
    			<type>button</type>
    			<id>9</id>
    			<label>Log out</label>
    			<onleft>50</onleft>
    			<onright>9</onright>
    			<onup>8</onup>
    			<ondown>2</ondown>
    		</control>
    		
    	</control>
    	
    </control>

    There is no special about this, but when I navigate down from button with ID 3 to button with ID 4, it doesn't do anything, and the log-error occurs.

    Took me a while to figure out what it was. No other skins has this CDATA in the visibility conditions, so they are not affected. Are you sure CDATA is allowed inside the condition?
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    It should work...<type>textbox</type> was given the the id of 4 (from references.xml). You will need to override the id in the textbox control e.g. id = 0.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #5
    ...but HeadWeb.xml doesn't have a textbox-control. Why do you set an id in references? Other plugins using myvideoFilmstripView.xml will have this issue as well. I just include myvideoFilmstripView.xml which is a file StreamedMP installs with the skin ;)

    In other words; I can't fix it, you can :)
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    It shouldn't, I will remove it from references. Im just explaining the issue to you so you know the root cause. If you included the filmstrip xml from streamedmp then you will have two references to id:4 (hence the error/screw up on navigation).
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #7
    It shouldn't, I will remove it from references. Im just explaining the issue to you so you know the root cause. If you included the filmstrip xml from streamedmp then you will have two references to id:4 (hence the error/screw up on navigation).

    I know :) Just didn't figure out that the ID was set in references.xml. It still puzzles me how removing the CDATA can fix the problem, since I didn't add an ID to the control. Well, we now know both the problem and the fix, and that's enough to make me happy ;)
     

    Users who are viewing this thread

    Top Bottom