I wanted to study some BASIC code from an extension published as an .oxt archive. So I extracted the BASIC files from the zip archive, as "Foobar.xba", e.g. It's very simple XML, with only a header element around the whole file, which is easy enough to ignore. But of course many of the operators and other punctuation characters are encoded as entities, as with HTML: & which makes the code rather difficult to read.
Is there some way to open such a file in OOo? File > Open in the BASIC editor naturally loads it into Writer as a text file--not very sensible. Do I have to install the extension in order to view the source comfortably?
Open in MSWord fails; Wordpad treats it as plain text. Open in Firefox almost works: it respects the XML header and decodes the entities, but also ignores all the whitespace: goodbye line breaks and indentation.
I must be missing something obvious again.
How to open a .xba BASIC file?
How to open a .xba BASIC file?
AOO4/LO5 • Linux • Fedora 23
Re: How to open a .xba BASIC file?
Somewhere I have a Python script with a class "XBAParser" or something.
Mmmh, got to search backup archives.
You could copy the xba to <profile>/user/basic/SomeLib/
and edit <profile>/user/basic/SomeLib/script.xlb to welcome your module as a new lib member:
Code: Select all
$ python parseXBA.py module.xba > module.txt
You could copy the xba to <profile>/user/basic/SomeLib/
and edit <profile>/user/basic/SomeLib/script.xlb to welcome your module as a new lib member:
Code: Select all
<library:element library:name="Module1"/>
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How to open a .xba BASIC file?
Ok. Well, I guess I didn't miss something obvious then 
I guess this could work too: [XML Filter] Create XSLT filters for import and export, but that still wouldn't load the file into the code editor, right?
Thanks for the suggestions. I think I can get something to work now.

I guess this could work too: [XML Filter] Create XSLT filters for import and export, but that still wouldn't load the file into the code editor, right?
Thanks for the suggestions. I think I can get something to work now.
AOO4/LO5 • Linux • Fedora 23
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: How to open a .xba BASIC file?
Hi,acknak wrote:I wanted to study some BASIC code from an extension published as an .oxt archive. So I extracted the BASIC files from the zip archive, as "Foobar.xba", e.g.
The simplest solution is to install the extension

Another solution:
- unzip the oxt somewhere.
- this xba file is in a directory. This directory name is a library name.
- use the Basic organizer to import the library. You have to select the dialog.xlb or script.xlb file
- now you have the library in My Macros and Dialogs.
______
Bernard