XML not well formatted?

Discuss GUI programming with the RapaGUI plugin here
Post Reply
leavereality
Posts: 38
Joined: Sat Sep 28, 2019 1:39 pm

XML not well formatted?

Post by leavereality »

Tired to figure out the issue, just trying to add a Page to my little LionGUI app, but i keep getting XML error on line 30, I cant see anything wrong, any help? the code for certain rabbit hole features are different for Windows and Linux, only done linux so far so the code the same for both at the moment.
Image

Code: Select all

#BLACK
@REQUIRE "RapaGUI"
@APPTITLE "LionGUI"
@APPVERSION "$VER: 1.1"
@APPCOPYRIGHT "(C) Copyright 2021 by Leave Reality Studio"
@APPAUTHOR "Vincent Perkins"
@APPDESCRIPTION "LionGUI"

moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application>
<window title="LionGUI">
   
	<vgroup title="Button">
      <pageview>

        <hgroup title="Pi">

          <vgroup frame="true" frametitle="OpenURL">
		    <button id="o1">Google</button>
            <button id="o2">AmigaWorld</button>
		    <button id="o3">Aminet</button>
		    <button id="o4">WhdDownLoad</button>
	      </vgroup>
	  
	    <vspace height="3"/>
	  
	      <vgroup frame="true" frametitle="Rabbit Hole">
		   <button id="b1">Browser</button>			
           <button id="b2">Audacious</button>
           <button id="b3">Office</button>
           <button id="b4">Host Settings</button>
           <button id="b5">File Manager</button>
           <button id="b6">Terminal</button>
		   <button id="b7">Power Off</button>
          </vgroup>
        </hgroup

        <hgroup title="Windows">

           <vgroup frame="true" frametitle="OpenURL">
       	    <button id="o5">Google</button>
            <button id="o6">AmigaWorld</button>
            <button id="o7">Aminet</button>
       	    <button id="o8">WhdDownLoad</button>
       	   </vgroup>

       	   <vspace height="3"/>

       	     <vgroup frame="true" frametitle="Rabbit Hole">
       		    <button id="b9">Browser</button>
                <button id="b10">Audacious</button>
                <button id="b11">Office</button>
                <button id="b12">Host Settings</button>
                <button id="b13">File Manager</button>
                <button id="b14">Terminal</button>
       		    <button id="b15">Power Off</button>
             </vgroup>
          </vgroup>
        </hgroup>
       </pageview>
     </hgroup>
 </window>
</application>
]])

InstallEventHandler({RapaGUI = Function(msg)

   Switch msg.class
   Case "Button":
    Switch msg.Attribute
    Case "Pressed":
        Switch msg.ID
        Case "o1":  ;
            OpenURL ("http://google.com")
		Case "o2":  ;
            OpenURL ("http://amigaworld.net")
		Case "o3":  ;
            OpenURL ("http://aminet.net")
		Case "o4":  ;
            OpenURL ("http://whdownload.com")
		Case "o5":  ;
            OpenURL ("http://google.com")
		Case "o6":  ;
            OpenURL ("http://amigaworld.net")
		Case "o7":  ;
            OpenURL ("http://aminet.net")
		Case "o8":  ;
            OpenURL ("http://whdownload.com")	
			
			
        Case "b1":  ;
            Execute ("host-run exo-open --launch WebBrowser")
        Case "b2":  ;
            Execute ("host-run audacious")
        Case "b3":  ;
            Execute ("host-run loffice")
        Case "b4":  ;
            Execute ("host-run xfce4-settings-manager")
        Case "b5":  ;
            Execute ("host-run exo-open --launch TerminalEmulator")
        Case "b6":  ;
            Execute ("host-run exo-open --launch FileManager")
		Case "b7":  ;
			Execute ("host-run poweroff")
		Case "b9":  ;
            Execute ("host-run exo-open --launch WebBrowser")
        Case "b10":  ;
            Execute ("host-run audacious")
        Case "b11":  ;
            Execute ("host-run loffice")
        Case "b12":  ;
            Execute ("host-run xfce4-settings-manager")
        Case "b13":  ;
            Execute ("host-run exo-open --launch TerminalEmulator")
        Case "b14":  ;
            Execute ("host-run exo-open --launch FileManager")
		Case "b15":  ;
			Execute ("host-run poweroff")
		EndSwitch
	EndSwitch
EndSwitch




   EndFunction})

Repeat
   WaitEvent
Forever
User avatar
mrupp
Posts: 147
Joined: Sun Jan 31, 2021 7:44 pm
Location: Switzerland
Contact:

Re: XML not well formatted?

Post by mrupp »

There were some errors in it. You had a missing > in </hgroup>, it began with a <vgroup> but ended with a </hgroup> and some other too-many-closing-tags. And some <vgroup title="Button"> that was outside of <pageview>, so "title" didn't make sense.

Here's the corrected version:

Code: Select all

#BLACK
@REQUIRE "RapaGUI"
@APPTITLE "LionGUI"
@APPVERSION "$VER: 1.1"
@APPCOPYRIGHT "(C) Copyright 2021 by Leave Reality Studio"
@APPAUTHOR "Vincent Perkins"
@APPDESCRIPTION "LionGUI"

moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
  <application>
    <window title="LionGUI">
  
      <vgroup>
        <pageview>
  
          <hgroup title="Pi">
  
            <vgroup frame="true" frametitle="OpenURL">
              <button id="o1">Google</button>
              <button id="o2">AmigaWorld</button>
              <button id="o3">Aminet</button>
              <button id="o4">WhdDownLoad</button>
            </vgroup>
  
            <vspace height="3" />
  
            <vgroup frame="true" frametitle="Rabbit Hole">
              <button id="b1">Browser</button>
              <button id="b2">Audacious</button>
              <button id="b3">Office</button>
              <button id="b4">Host Settings</button>
              <button id="b5">File Manager</button>
              <button id="b6">Terminal</button>
              <button id="b7">Power Off</button>
            </vgroup>
          </hgroup>
  
          <hgroup title="Windows">
  
            <vgroup frame="true" frametitle="OpenURL">
              <button id="o5">Google</button>
              <button id="o6">AmigaWorld</button>
              <button id="o7">Aminet</button>
              <button id="o8">WhdDownLoad</button>
            </vgroup>
  
            <vspace height="3" />
  
            <vgroup frame="true" frametitle="Rabbit Hole">
              <button id="b9">Browser</button>
              <button id="b10">Audacious</button>
              <button id="b11">Office</button>
              <button id="b12">Host Settings</button>
              <button id="b13">File Manager</button>
              <button id="b14">Terminal</button>
              <button id="b15">Power Off</button>
            </vgroup>
          </hgroup>
        </pageview>
      </vgroup>
    </window>
  </application>
]])

InstallEventHandler({RapaGUI = Function(msg)

   Switch msg.class
   Case "Button":
    Switch msg.Attribute
    Case "Pressed":
        Switch msg.ID
        Case "o1":  ;
            OpenURL ("http://google.com")
		Case "o2":  ;
            OpenURL ("http://amigaworld.net")
		Case "o3":  ;
            OpenURL ("http://aminet.net")
		Case "o4":  ;
            OpenURL ("http://whdownload.com")
		Case "o5":  ;
            OpenURL ("http://google.com")
		Case "o6":  ;
            OpenURL ("http://amigaworld.net")
		Case "o7":  ;
            OpenURL ("http://aminet.net")
		Case "o8":  ;
            OpenURL ("http://whdownload.com")	
			
			
        Case "b1":  ;
            Execute ("host-run exo-open --launch WebBrowser")
        Case "b2":  ;
            Execute ("host-run audacious")
        Case "b3":  ;
            Execute ("host-run loffice")
        Case "b4":  ;
            Execute ("host-run xfce4-settings-manager")
        Case "b5":  ;
            Execute ("host-run exo-open --launch TerminalEmulator")
        Case "b6":  ;
            Execute ("host-run exo-open --launch FileManager")
		Case "b7":  ;
			Execute ("host-run poweroff")
		Case "b9":  ;
            Execute ("host-run exo-open --launch WebBrowser")
        Case "b10":  ;
            Execute ("host-run audacious")
        Case "b11":  ;
            Execute ("host-run loffice")
        Case "b12":  ;
            Execute ("host-run xfce4-settings-manager")
        Case "b13":  ;
            Execute ("host-run exo-open --launch TerminalEmulator")
        Case "b14":  ;
            Execute ("host-run exo-open --launch FileManager")
		Case "b15":  ;
			Execute ("host-run poweroff")
		EndSwitch
	EndSwitch
EndSwitch




   EndFunction})

Repeat
   WaitEvent
Forever
Cheers, Michael
leavereality
Posts: 38
Joined: Sat Sep 28, 2019 1:39 pm

Re: XML not well formatted?

Post by leavereality »

Thank You!

Its really handy to see where I went wrong, Cheers
Post Reply