LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-06-2017, 12:17 PM   #1
rolypolycat
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
xml-extra content at the end of the document- (in openbox)


xml-extra content at the end of the document

Hello!
I am trying to get certain apps to open at a configured size and desktop in Openbox. I followed the examples given in the rc.xml file, but when I restart openbox, I get this error:One or more xml syntax errors while parsing the openbox configuration files.the last error seen was in file "home/michelle/.config/openbox/rc.xml line 703 with message:Extra content at the end of the document.
I don't know enough about programming xml to understand this message, and the info I found online seemed to do more with php and xml than openbox. My rc.xml file is below; can anyone more knowledgeable tell me what is wrong and how I can fix it? Thanks in advance!


</applications>
</application> <-----(this is line 703)
<application class="pcmanfm", "Pcmanfm">
<application name="pcmanfm", "Pcmanfm">
<desktop>1</desktop>
</size>
<width>1632</width>
<height>949</height>
</size>
<position force="no">
<x>16</x>
<y>35</y>
</position>
<layer>normal</layer>
</application>
</application>
<application class="deadbeef", "Deadbeef">
<application name="deadbeef","Deadbeef",>
<desktop>1</desktop>
</size>
<width>500</width>
<height>300</height>
</size>
<position force="no">
<x>1339</x>
<y>518</y>
</position>
<layer>normal</layer>
</application>
</application>
<application class="Navigator", "Firefox-esr">
<application name="Startpage Search Engine - Mozilla Firefox">
<desktop>2</desktop>
</size>
<width>1670</width>
<height>946</height>
</size>
<position force="no">
<x>1339</x>
<y>518</y>
</position>
<layer>normal</layer>
</application>
</application>
<application class="mousepad", "Mousepad">
<application name="mousepad", "Mousepad">
<desktop>1</desktop>
</size>
<width>985</width>
<height>964</height>
</size>
<position force="no">
<x>568</x>
<y>68</y>
</position>
<layer>normal</layer>
</application>
</application>
<application class="gpicview","Gpicview">
<application name="gpicview", "Gpicview">
<desktop>1</desktop>
</size>
<width>1149</width>
<height>979</height>
</size>
<position force="no">
<x>1149</x>
<y>979</y>
</position>
<layer>normal</layer>
</application>
</application>
<application class="vlc","Vlc">
<application name="vlc","Vlc">
<application role="vlc-main">
<desktop>3</desktop>
</size>
<width>1638</width>
<height>971</height>
</size>
<position force="no">
<x>1638</x>
<y>971</y>
</position>
<layer>normal</layer>
</application>
</openbox_config>

Last edited by rolypolycat; 08-06-2017 at 12:37 PM.
 
Old 08-06-2017, 07:33 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I don't use openbox, but by perusing Debian's example rc.xml file (https://sources.debian.net/src/openb...a/rc.xml/#L751) and knowing a little xml, here are a few comments that I hope will help:
Code:
</applications>  <-- should be after last </application> see link above
</application> <-----(this is line 703)   <-- don't need this unless you opened  an application tag that you don't show
<application class="pcmanfm", "Pcmanfm">  <-- combine this and the next line see below
<application name="pcmanfm", "Pcmanfm">
<desktop>1</desktop>
</size>             <-- should be opening the size tag - lose the slash
<width>1632</width>
<height>949</height>
</size>
<position force="no">
<x>16</x>
<y>35</y>
</position>
<layer>normal</layer>
</application>          <-- if you combine the <application> lines above you only need one </application>
</application>
Revised:
Code:
<application class="pcmanfm" name="pcmanfm">     <-- no comma
<desktop>1</desktop>
<size>            
<width>1632</width>
<height>949</height>
</size>
<position force="no">
<x>16</x>
<y>35</y>
</position>
<layer>normal</layer>
</application>
...
All of your other xml modified as above
...
</applications>
</openbox_config>

Last edited by norobro; 08-06-2017 at 09:18 PM.
 
Old 08-06-2017, 09:42 PM   #3
rolypolycat
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I tried what you said, but it still doesn't like line 703-the one I marked. I guess I should have explained that's the line in the entire file the error message complains about; I added it so folks wouldn't have to guess which line. I still get the same error, but I have no idea what "extra content" openbox is seeing. Anyway, here's the new file:

</application>
<application class="pcmanfm" name="pcmanfm">
<desktop>1</desktop>
<size>
<width>1632</width>
<height>949</height>
</size>
<position force="no">
<x>16</x>
<y>35</y>
</position>
<layer>normal</layer>
</application>
<application class="deadbeef" name="deadbeef">
<desktop>1</desktop>
<size>
<width>500</width>
<height>300</height>
</size>
<position force="no">
<x>1339</x>
<y>518</y>
</position>
<layer>normal</layer>
</application>
<application class="Navigator", "Firefox-esr">
<application name="Startpage Search Engine - Mozilla Firefox">
<desktop>2</desktop>
<size>
<width>1670</width>
<height>946</height>
</size>
<position force="no">
<x>1339</x>
<y>518</y>
</position>
<layer>normal</layer>
</application>
<application class="mousepad" name="mousepad">
<desktop>1</desktop>
<size>
<width>985</width>
<height>964</height>
</size>
<position force="no">
<x>568</x>
<y>68</y>
</position>
<layer>normal</layer>
</application>
<application class="gpicview" name="gpicview">
<desktop>1</desktop>
<size>
<width>1149</width>
<height>979</height>
</size>
<position force="no">
<x>1149</x>
<y>979</y>
</position>
<layer>normal</layer>
</application>
<application class="vlc" name="vlc">
<application role="vlc-main">
<desktop>3</desktop>
</ize>
<width>1638</width>
<height>971</height>
</size>
<position force="no">
<x>1638</x>
<y>971</y>
</position>
<layer>normal</layer>
</application>
</openbox_config>

I left the Firefox entry the same because I always open to Startpage search engine-it's my home page, so I thought I should keep that. I tried removing the extra "pcmanfm", but openbox didn't like that, either.

Thanks for your help, though; I appreciate it! I'm open to any other ideas to try.
 
Old 08-06-2017, 11:01 PM   #4
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
It makes code easier to read if you use code tags. It puts content in a box with scrollbars if necessary. You can do that by clicking "go advanced" and then the "#" symbol at the top of the box. Or you can just type [code]your content[/code]

Please post some of the lines, say 20, before line 703. That first line that you posted "</application>" is a closing tag. Is it preceded by an opening tag "<application>"?

Also you need to change these lines:
Code:
<application class="Navigator", "Firefox-esr">
<application name="Startpage Search Engine - Mozilla Firefox">
...
...
<application class="vlc" name="vlc">
<application role="vlc-main">
To:
Code:
<application class="Navigator" name="Startpage Search Engine - Mozilla Firefox">
...
...
<application class="vlc" name="vlc" role="vlc-main">
 
Old 08-07-2017, 12:49 AM   #5
rolypolycat
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Original Poster
Rep: Reputation: 0
This is the part of the file just above what I have. Since it's all examples, I just cut it out of my file.

</menu>

<applications>
<!--
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
# you may use one or more of the name/class/role/title/type rules to specify
# windows to match

<application name="the window's _OB_APP_NAME property (see obxprop)"
class="the window's _OB_APP_CLASS property (see obxprop)"
groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
role="the window's _OB_APP_ROLE property (see obxprop)"
title="the window's _OB_APP_TITLE property (see obxprop)"
type="the window's _OB_APP_TYPE property (see obxprob)..
(if unspecified, then it is 'dialog' for child windows)">
# you may set only one of name/class/role/title/type, or you may use more
# than one together to restrict your matches.

# the name, class, role, and title use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.

# the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
# or desktop

# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list


# each rule element can be left out or set to 'default' to specify to not
# change that attribute of the window

<decor>yes</decor>
# enable or disable window decorations

<shade>no</shade>
# make the window shaded when it appears, or not

<position force="no">
# the position is only used if both an x and y coordinate are provided
# (and not set to 'default')
# when force is "yes", then the window will be placed here even if it
# says you want it placed elsewhere. this is to override buggy
# applications who refuse to behave
<x>center</x>
# a number like 50, or 'center' to center on screen. use a negative number
# to start from the right (or bottom for <y>), ie -50 is 50 pixels from
# the right edge (or bottom). use 'default' to specify using value
# provided by the application, or chosen by openbox, instead.
<y>200</y>
<monitor>1</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>

<size>
# the size to make the window.
<width>20</width>
# a number like 20, or 'default' to use the size given by the application.
# you can use fractions such as 1/2 or percentages such as 75% in which
# case the value is relative to the size of the monitor that the window
# appears on.
<height>30%</height>
</size>

<focus>yes</focus>
# if the window should try be given focus when it appears. if this is set
# to yes it doesn't guarantee the window will be given focus. some
# restrictions may apply, but Openbox will try to

<desktop>1</desktop>
# 1 is the first desktop, 'all' for all desktops

<layer>normal</layer>
# 'above', 'normal', or 'below'

<iconic>no</iconic>
# make the window iconified when it appears, or not

<skip_pager>no</skip_pager>
# asks to not be shown in pagers

<skip_taskbar>no</skip_taskbar>
# asks to not be shown in taskbars. window cycling actions will also
# skip past such windows

<fullscreen>yes</fullscreen>
# make the window in fullscreen mode when it appears

<maximized>true</maximized>
# 'Horizontal', 'Vertical' or boolean (yes/no)
</application>

# end of the example
-->
My file- the part openbox doesn't like-starts right here. I made the changes you recommended to firefox and vlc.
 
Old 08-07-2017, 03:24 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,426
Blog Entries: 10

Rep: Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248Reputation: 5248
you must use code tags here on the forum.

you must learn to troubleshoot your own config files, if you edit them manually.
admittedly xml is a b!tch to edit manually, and openbox' error messages are notoriously vague - it could be just a misplaced quote, or any number of things.

to make things easier on your own machine, you need a plain text editor with syntax highlighting!
i recommend geany, because it's lightweight.
the coloring of the code might tell you what's going on already.
also indentation helps, like this:
Code:
<tag1>
    <tag2>
      content bla bla
    </tag2>
</tag1>
it's very much like HTML, opening and closing nested tags...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] openbox- autostart.sh, rc.xml, menu.xml fail to load new-here Slackware 2 08-07-2012 07:15 PM
[SOLVED] openbox - menu.xml - syntax error quexxon-12 Linux - Software 3 06-04-2011 01:03 AM
Cannot cp menu.xml, rc.xml, and autostart.sh (Openbox) oalicein Linux - Newbie 2 02-10-2011 05:52 PM
Can't create custom menu.xml for openbox LogicNZ Linux - Newbie 6 07-19-2008 10:37 AM
OpenBox menu.xml error Cmdr_K00n Linux - Newbie 1 06-22-2004 06:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration