[Scribus] Parsing an .sla file with perl
Gregory Pittman
gpittman
Fri Mar 17 02:11:47 CET 2006
Gregory Pittman wrote:
> Here is a small program from Perl & XML (O'Reilly) to create a tree
> display parsing a Scribus file.
>
> One trick one needs to do is to go through and change in Ctrl-E's,
> since this causes an error in XML::Parser.
> In emacs, I took my file, did Shift-Alt-% (Search and Replace), then
> Ctrl-Q, Ctrl-E (you have to use Ctrl-Q to be able to enter Ctrl-E),
> and replaced it with @ (so I could find and switch back later).
>
> After that, Scribus files parse without problems.
Sorry again. The server is "quarantining" the file.
Will show it inline (it's quite small, and as you can see, innocuous):
#! /usr/bin/env perl
# this is from Perl & XML,
# ET Ray & J McIntosh
# O'Reilly & Associates, 2002
# Example 3-3, p 46
use XML::Parser;
$parser = new XML::Parser( Style => 'Tree' );
my $tree = $parser->parsefile( shift @ARGV );
use Data::Dumper;
print Dumper( $tree );
Greg
More information about the scribus
mailing list