[liblouis-liblouisxml] Re: Getting unwanted blank lines at end of BRF

  • From: "John Brugge" <johnbrugge@xxxxxxxxxxxx>
  • To: "liblouis-liblouisxml@xxxxxxxxxxxxx" <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Tue, 17 May 2011 07:34:28 -0700

FWIW, the thing that appeared to make a difference for the xml2brl command
when invoked through the Java ProcessBuilder was the path to the
configuration file. We tell ProcessBuilder to invoke xml2brl from within
the directory that contains the config file, but if you then give it a
relative path in the -f argument, it adds the extra blank lines to the end
of the BRF that I was seeing. If the -f argument has the absolute path to
the config file, then all is good.

The command line args I listed in the original message I now realize must
have been from some notes after I had been fiddling with the problem. It
took me a while to notice the difference, but once I noticed that my Java
code change had inadvertently changed the path from absolute to relative,
then things started working correctly again.

I'm still not sure why that difference would end up adding so many blank
lines, and yet making no discernible difference otherwise. The only other
difference I found in the generated BRF was a couple of lines where there
was an extra space at the end, but with no real pattern I could find.

In any event, I'm back to a stable conversion, so thanks again for the
pointers.

John Brugge

On 5/13/11 7:57 AM, "John  Brugge" <johnbrugge@xxxxxxxxxxxx> wrote:

>Thanks John, I'll poke around a bit more on the Java side. The Java
>binding of liblouisutdml does sound appealing, too.
>
>John
>
>On 5/12/11 12:23 PM, "John J. Boyer" <john@xxxxxxxxxxxxxx> wrote:
>
>>The command line looks ok except for the huge number of lines per page.
>>If you don't want braille page numbers and form feeds just specify
>>braillePages no 
>>
>>The extra blank lines would seem to be a Java issue. I think there have
>>been problems with the ProcessBuilder class. You can get around using
>>this class altogether by using liblouisutdml, which has Java bindings,
>>including for a method called file@brl which behaves like xml2brl and
>>takes an array of String with the same arguments, except that C and the
>>configuration setting it refers to are separate arguments.
>>
>>I'm glad you have subscribed to liblouis-liblouuisxml. You may wish to
>>subscribe to brailleblaster@xxxxxxxxxxxxx also
>>
>>Thanks,
>>John
>>
>>On Thu, May 12, 2011 at 08:35:59AM -0700, John  Brugge wrote:
>>> Hello,
>>> 
>>> I'm having a strange situation where I am getting 8,190 blank lines at
>>>the end of my converted BRF, but only for some input files, and only for
>>>some invocations, and I'm unable to pinpoint what would be causing it.
>>> 
>>> We are using liblouisxml 2.1.0, and I'm seeing this on both OS X and
>>>Linux. What is strangest is that this only happens when running xml2brl
>>>from Java, using the ProcessBuilder class. This is a class for running
>>>external command-line programs from within Java. When I capture the
>>>full command line that is generated by this, and run the equivalent
>>>command from a terminal window, using the same input XML file, the BRF
>>>does not have any blank lines at the end, and otherwise has no
>>>differences. Furthermore, while this doesn't happen with all input XML,
>>>in those cases where it does happen, the number of blank lines is always
>>>8,190, no matter the length of the input XML.
>>> 
>>> The command line looks like this:
>>> xml2brl \
>>> -f 
>>>/Users/john/.benetech/liblouis/converterPackage/bookshare-refreshable.cf
>>>g
>>> \
>>> -CliteraryTextTable=en-us-brf.dis,en-us-g1.ctb \
>>> -CuncontractedTable=en-us-g1.ctb \
>>> -CcompbrlTable=en-us-comp8.ctb \
>>> -CeditTable=edittable.ctb \
>>> -CcellsPerLine=40 \
>>> -ClinesPerPage=2147483646 \
>>> -CprintPages=yes \
>>> /Users/john/brfTest/Little_Brother-prepared.xml \
>>> /Users/john/brfTest/Little_Brother-manual.brf
>>> 
>>> Attached is the bookshare-refreshable.cfg file, which is one that we
>>>have been using for a long time without incident. I can pass along a
>>>sample XML file if that would be useful.
>>> 
>>> Any clues, or pointers to ways to debug this, are appreciated.
>>> Thanks,
>>> John Brugge
>>> Bookshare.org
>>
>>
>>
>>-- 
>>John J. Boyer, Executive Director
>>GodTouches Digital Ministry, Inc.
>>http://www.godtouches.org
>>Madison, Wisconsin, USA
>>Peace, Love, Service
>>
>>For a description of the software, to download it and links to
>>project pages go to http://www.abilitiessoft.com
>>
>

Other related posts: