R
Rudra Banerjee
Dear friends,
I am trying to write a gcstar export for Latex, and I am a perl-illiterate.
From other gcstar scripts, I am following the pattern.
The gcstar structure is like:
<item
id="1"
title="A Beautiful Mind"
date="2001"
time="130 min."
director="Ron Howard"
image="Movies_pictures/A_Beautiful_Mind_0.jpg"
backpic=""
original="A Beautiful Mind"
webPage="http://www.filmaffinity.com/en/film326587.html##Film affinity (EN)"<country>
<line>
<col>United States</col>
</line>
</country>
<genre>
<line>
<col>Drama</col>
</line>
</genre>
</item>
Now, the other fields with key value structure is done, but I don't understand how to get things like
<country>
<line>
<col>United States</col>
</line>
</country>
My complete code for the export may be quite too large, but for a snippet, what I am trying to do is as:
sub getItem {
my ($self, $item, $number) = @_;
my $result;
return '' if ($self->{options}->{one} &&
$item->{number} ne $self->{options}->{disc});
$result .= '\item {\bf ' . $self->transformValue ($item->{title},"title") . "}";
# $result .= " ($item->{date})" if $item->{date};
# one line for russian cartoons
if ($self->transformValue ($item->{genre}, 'genre') =~
m/Мультфильм/) {
$result .= ' м/ф';
} elsif ($item->{genre} || $item->{director} ||
$item->{audio} || $item->{time}) {
$result .= "\\\\\n\\begin{tabular}{l|ll}\n";
$result .= '\multirow{5}{*}{\includegraphics[height=1in]{'. $self->transformValue ($item->{image}, 'image') . '}}'
if $item->{image};
$result .='\\ & ' . $self->getLocal('date') . ': & ' .
$self->transformValue ($item->{date}, 'date') . '\\'
if $item->{date};
$result .='\\ & ' . $self->getLocal('genre') . ': & ' .
$self->transformValue ($item->{genre}, 'genre') . '\\'
if $item->{genre};
$result .='\\ & ' . $self->getLocal('director') . ": & $item->{director}\\"
if $item->{director};
$result .='\\ & ' . $self->getLocal('time') . ": & $item->{time} мин.\\\\" if $item->{time};
$result .='\\ & ' . $self->getLocal('country') . ": & " if $item->{country};
$result .= "\n\\end{tabular}\n";
}
I will be grateful if someone here kindly show me the way.
I am trying to write a gcstar export for Latex, and I am a perl-illiterate.
From other gcstar scripts, I am following the pattern.
The gcstar structure is like:
<item
id="1"
title="A Beautiful Mind"
date="2001"
time="130 min."
director="Ron Howard"
image="Movies_pictures/A_Beautiful_Mind_0.jpg"
backpic=""
original="A Beautiful Mind"
webPage="http://www.filmaffinity.com/en/film326587.html##Film affinity (EN)"<country>
<line>
<col>United States</col>
</line>
</country>
<genre>
<line>
<col>Drama</col>
</line>
</genre>
</item>
Now, the other fields with key value structure is done, but I don't understand how to get things like
<country>
<line>
<col>United States</col>
</line>
</country>
My complete code for the export may be quite too large, but for a snippet, what I am trying to do is as:
sub getItem {
my ($self, $item, $number) = @_;
my $result;
return '' if ($self->{options}->{one} &&
$item->{number} ne $self->{options}->{disc});
$result .= '\item {\bf ' . $self->transformValue ($item->{title},"title") . "}";
# $result .= " ($item->{date})" if $item->{date};
# one line for russian cartoons
if ($self->transformValue ($item->{genre}, 'genre') =~
m/Мультфильм/) {
$result .= ' м/ф';
} elsif ($item->{genre} || $item->{director} ||
$item->{audio} || $item->{time}) {
$result .= "\\\\\n\\begin{tabular}{l|ll}\n";
$result .= '\multirow{5}{*}{\includegraphics[height=1in]{'. $self->transformValue ($item->{image}, 'image') . '}}'
if $item->{image};
$result .='\\ & ' . $self->getLocal('date') . ': & ' .
$self->transformValue ($item->{date}, 'date') . '\\'
if $item->{date};
$result .='\\ & ' . $self->getLocal('genre') . ': & ' .
$self->transformValue ($item->{genre}, 'genre') . '\\'
if $item->{genre};
$result .='\\ & ' . $self->getLocal('director') . ": & $item->{director}\\"
if $item->{director};
$result .='\\ & ' . $self->getLocal('time') . ": & $item->{time} мин.\\\\" if $item->{time};
$result .='\\ & ' . $self->getLocal('country') . ": & " if $item->{country};
$result .= "\n\\end{tabular}\n";
}
I will be grateful if someone here kindly show me the way.