Commit e91a1885 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Output change in xml_tranform.

        * arthur/xml_transform/README
        * arthur/xml_transform/templates/opendoc/xsl.xsl
        * arthur/xml_transform/templates/pdf/main.xsl
        * arthur/xml_transform/templates/pdf/regions.xsl

        * arthur/xml_transform/image_crop.cc,
        * arthur/xml_transform/image_crop.hh: Change ppm loader to magick loader.
        * arthur/xml_transform/main.cc: Change man.

        * arthur/xml_transform/templates/pdf/main_crop_64.xsl,
        * arthur/xml_transform/templates/pdf/regions_base64.xsl,
        * arthur/xml_transform/templates/pdf/regions_png.xsl,
        * arthur/xml_transform/templates/html/html_generator.sh,
        * arthur/xml_transform/templates/pdf/svg_generator.sh,
        * arthur/xml_transform/templates/pdf/pdf_generator.sh: Delete.

        * arthur/xml_transform/templates/html/xsl.xsl: Rename as...
        * thur/xml_transform/templates/html/main.xsl: ...This.
        * arthur/xml_transform/templates/html/xsl_base64.xsl: Rename as...
        * arthur/xml_transform/templates/html/main.xsl: ...This.
        * arthur/xml_transform/templates/pdf/regions_svg.xsl: Rename as...
        * arthur/xml_transform/templates/svg/regions.xsl: ...This.

        * arthur/xml_transform/templates/xml_transform.sh,
        * arthur/xml_transform/templates/svg/line.xsl,
        * arthur/xml_transform/templates/ooconvert,
        * arthur/xml_transform/templates/pdf/full/line.xsl: New.

        * arthur/xml_transform/xml_transform.cc,
        * arthur/xml_transform/xml_transform.hh: Change output.
        * arthur/xml_transform/xml_transform.pro: Add QMAKE_POST_LINK.
parent 9c0bdaa0
2010-07-23 Arthur Crepin-Leblond <crepin@ptaouchnok.lrde.epita.fr>
2010-08-05 Arthur Crepin-Leblond <crepin@ptaouchnok.lrde.epita.fr@>
Output change in xml_tranform.
* arthur/xml_transform/README
* arthur/xml_transform/templates/opendoc/xsl.xsl
* arthur/xml_transform/templates/pdf/main.xsl
* arthur/xml_transform/templates/pdf/regions.xsl
* arthur/xml_transform/image_crop.cc,
* arthur/xml_transform/image_crop.hh: Change ppm loader to magick loader.
* arthur/xml_transform/main.cc: Change man.
* arthur/xml_transform/templates/pdf/main_crop_64.xsl,
* arthur/xml_transform/templates/pdf/regions_base64.xsl,
* arthur/xml_transform/templates/pdf/regions_png.xsl,
* arthur/xml_transform/templates/html/html_generator.sh,
* arthur/xml_transform/templates/pdf/svg_generator.sh,
* arthur/xml_transform/templates/pdf/pdf_generator.sh: Delete.
* arthur/xml_transform/templates/html/xsl.xsl: Rename as...
* thur/xml_transform/templates/html/main.xsl: ...This.
* arthur/xml_transform/templates/html/xsl_base64.xsl: Rename as...
* arthur/xml_transform/templates/html/main.xsl: ...This.
* arthur/xml_transform/templates/pdf/regions_svg.xsl: Rename as...
* arthur/xml_transform/templates/svg/regions.xsl: ...This.
* arthur/xml_transform/templates/xml_transform.sh,
* arthur/xml_transform/templates/svg/line.xsl,
* arthur/xml_transform/templates/ooconvert,
* arthur/xml_transform/templates/pdf/full/line.xsl: New.
* arthur/xml_transform/xml_transform.cc,
* arthur/xml_transform/xml_transform.hh: Change output.
* arthur/xml_transform/xml_transform.pro: Add QMAKE_POST_LINK.
2010-07-23 Arthur Crepin-Leblond <crepin@lrde.epita.fr>
OpenDocument output (odt and odf).
......@@ -13,7 +49,7 @@
* arthur/xml_transform/xml_transform.cc
* arthur/xml_transform/xml_transform.hh
2010-07-22 Arthur Crepin-Leblond <crepin@ptaouchnok.lrde.epita.fr>
2010-07-22 Arthur Crepin-Leblond <crepin@lrde.epita.fr>
SVG output.
......@@ -60,7 +96,7 @@
* arthur/xml_transform/templates/pdf/regions.xsl: Rename as...
* arthur/xml_transform/templates/pdf/regions_png.xsl:...this.
2010-07-08 Arthur Crepin-Leblond <crepin@ptaouchnok.lrde.epita.fr>
2010-07-08 Arthur Crepin-Leblond <crepin@lrde.epita.fr>
XML transform program.
......@@ -99,7 +135,7 @@
* arthur/xml_transform/templates/pdf/regions.xsl,
* arthur/xml_transform/xml_transform.pro: New.
2010-07-05 Arthur Crepin-Leblond <crepin@stockholm.lrde.epita.fr>
2010-07-05 Arthur Crepin-Leblond <crepin@lrde.epita.fr>
ICDAR XML to HTML.
......
......@@ -2,35 +2,31 @@ xml_transform
OPTIONS:
HTML output:
--html <xml> <ppm> <out_dir> : HTML output with non-text regions cropped into many png files.
--html-base64 <xml> <out_dir> : HTML output from a container XML file.
--html input.xml image output.html Creates HTML file, images are embedded inside in base 64 format.
--html-base64 input.xml output.html Same as --html but input is a XML file with images encoded in base 64 inside.
--html-full input.xml image output_dir Creates HTML file without converting images in base 64. Images + HTML file are placed in output_dir.
PDF output:
--pdf <xml> <ppm> <out_dir> : PDF output with non-text regions cropped into many png files.
--pdf-no-crop <xml> <ppm> <out_dir>: PDF output with the entire picture displayed over the text.
--pdf-base64 <xml> <out_dir> : PDF output from a container XML file.
--pdf-base64-no-crop <xml> <ppm> <out_dir> : PDF with the entire picture displayed over the text, the picture is loaded from a container XML file.
--pdf input.xml image output.pdf Creates PDF file, images are embedded inside in base 64 format.
--pdf-base64 input.xml output.pdf Same as --pdf but input is a XML file with images encoded in base 64 inside.
SVG output:
--svg <xml> <out_dir> : SVG output (works only with base 64 xml encoded.
Base 64 operations:
--to-base64 <xml> <ppm> <out_xml> : Produces a container XML file by converting cropped pictures into base 64 format.
SVG output (experimental, may not work with all files):
--svg input.xml image output.svg Creates SVG file, images are embedded inside in base 64 format.
--svg-base64 input.xml output.svg Same as --svg but input is a XML file with images encoded in base 64 inside.
OpenDocument output:
--open <xml> <ppm> <out_dir> : OpenDocument output (odt, odf).
--oo-doc input.xml image output.odt Creates Open Document Writer (odt) file.
Base 64 operations:
--to-base64 <xml> <ppm> <out_xml> : Produces a container XML file by converting cropped pictures into base 64 format.
--to-base64-no-crop <xml> <ppm> <out_xml> : Same as to-base64 but only the picture is converted in base 64.
--from-base64 <xml> <out_dir> : Decodes a XML container file to produce original image files.
--to-base64 input.xml image output.xml Creates a container XML file. It will contain regions which are cropped and converted in base 64.
--to-base64-no-crop input.xml mage output.xml Same as --to-base64 but only the full picture will be converted, regions are not cropped
--from-base64 input.xml output_dir Decodes a XML file which has been encoded in base 64, regions will be converted into png files and saved in output_dir.
For PDF/HTML/SVG/OD output, Bourne shell scripts are provided to produce the outputs, just run sh *_generator.sh
Requirements:
PDF : fop >= 0.95
HTML : xsltproc
SVG : trunk version of fop
OpenDocument : ooconvert
OpenDocument : ooconvert (included)
BUILD:
......@@ -38,7 +34,6 @@ Chnage the environment variable QMAKE_CXXFLAGS in xml_transfrom.pro then
mkdir _build
cd _build
cp -r ../templates .
qmake ../xml_transfrom.pro
make
......
......@@ -34,6 +34,7 @@
#include <mln/core/alias/box2d.hh>
#include <mln/core/image/image2d.hh>
#include <mln/io/magick/save.hh>
#include <mln/io/magick/load.hh>
#include <mln/io/ppm/all.hh>
ImageCrop::ImageCrop(QString xml, QString img, QString output) :
......@@ -47,26 +48,15 @@ ImageCrop::~ImageCrop()
{
}
/* Save PPM image to PNG format in output_dir/img. */
void ImageCrop::save_image(QString file)
/* Save image to PNG format in output_dir/img. */
void ImageCrop::save_image(QString out)
{
using namespace mln;
image2d<value::rgb8> ima;
io::ppm::load(ima, image_.toStdString());
io::magick::load(ima, image_.toStdString());
QString filename;
if (file == QString::Null())
filename = Common::get_file_name(image_);
else
filename = file;
// std::cout << "Saving " << image_.toStdString() << " to "
// << output_dir_.toStdString() << "img/"
// << filename.toStdString() << ".png"
// << std::endl;
io::magick::save(ima, output_dir_.toStdString() + "img/" + filename.toStdString() + ".png");
io::magick::save(ima, out.toStdString());
}
/* Return the image in base 64. */
......@@ -83,7 +73,7 @@ QString ImageCrop::img_to_base64()
}
/* Decode the base 64 string str and save into output_dir_/img/img_name. */
bool ImageCrop::img_from_base64(QString str, QString img_name, QString mime)
bool ImageCrop::img_from_base64(QString str, QString img)
{
QByteArray ba;
......@@ -91,7 +81,7 @@ bool ImageCrop::img_from_base64(QString str, QString img_name, QString mime)
QByteArray out_ba = QByteArray::fromBase64(ba);
QImage ima = QImage::fromData(out_ba);
return ima.save(output_dir_ + "img/" + img_name + "." + mime);
return ima.save(output_dir_ + img);
}
/* Read all regions of the XML file and save all base 64 data into output_dir/img */
......@@ -125,7 +115,8 @@ void ImageCrop::from_base64()
{
QString data = node.firstChildElement("data").text();
QString mime = node.firstChildElement("mime").text();
img_from_base64(data, id, mime);
QString img = id + "." + mime;
img_from_base64(data, img);
}
}
child = child.nextSibling();
......@@ -138,6 +129,21 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
{
QFile file(xml_);
file.open(QIODevice::ReadOnly);
QDomDocument doc;
doc.setContent(&file);
QDomElement root = doc.documentElement();
QDomNode child = root.firstChild();
while (!child.isNull() && !child.toElement().tagName().contains("page"))
child = child.nextSibling();
QString width = child.toElement().attribute("image_width", "0");
QString height = child.toElement().attribute("image_height", "0");
file.close();
file.open(QIODevice::ReadOnly);
QTextStream stream(&file);
QFile file2(out_file);
......@@ -163,9 +169,10 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
stream2 << "\n" << " <container>\n";
stream2 << " <mime>png</mime>\n";
QString file_name = Common::get_file_name(image_);
save_image();
QFile img(output_dir_ + "img/" + file_name + ".png");
QTemporaryFile tmp(output_dir_ + Common::get_file_name(image_) + "_XXXXXX.png");
tmp.open();
save_image(tmp.fileName());
QFile img(tmp.fileName());
img.open(QIODevice::ReadOnly);
stream2 << " <data>\n";
......@@ -178,7 +185,9 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
stream2 << "\n <coords>\n";
stream2 << " <point x=\"0\" y=\"0\" />\n";
stream2 << " <point x=\"0\" y=\"0\" />";
stream2 << " <point x=\"" << width << "\" y=\"0\" />\n";
stream2 << " <point x=\"" << width << "\" y=\"" << height << "\" />\n";
stream2 << " <point x=\"0\" y=\"" << height << "\" />";
stream2 << "\n </coords>";
stream2 << "\n" << " </image_region>\n";
......@@ -210,7 +219,7 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
QDomElement root = doc.documentElement();
QString id = root.attribute("id", "none");
QFile img(output_dir_ + "img/" + id + ".png");
QFile img(region_map_[id]);
img.open(QIODevice::ReadOnly);
stream2 << " <data>\n";
......@@ -220,6 +229,7 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
stream2 << " </data>";
stream2 << "\n </container>";
img.remove();
img.close();
}
......@@ -233,7 +243,7 @@ void ImageCrop::to_base64(QString out_file, bool no_crop)
file.close();
}
bool ImageCrop::crop_regions()
bool ImageCrop::crop_regions(bool temp)
{
Loader loader;
QFile f(xml_);
......@@ -265,7 +275,7 @@ bool ImageCrop::crop_regions()
QDomNode coords = region.firstChild();
QString id = region.toElement().attribute("id", "none");
qDebug() << region.toElement().tagName();
// qDebug() << region.toElement().tagName();
while (!coords.isNull() && !coords.toElement().tagName().contains("coords"))
coords = coords.nextSibling();
......@@ -301,10 +311,19 @@ bool ImageCrop::crop_regions()
box2d box = make::box2d(y_min, x_min, y_max, x_max);
image2d<value::rgb8> ima;
io::ppm::load(ima, image_.toStdString());
io::magick::load(ima, image_.toStdString());
ima = scribo::preprocessing::crop(ima, box);
io::magick::save(ima, output_dir_.toStdString() + "img/" + id.toStdString() + ".png");
if (temp)
{
QTemporaryFile tmp(output_dir_ + id + ".XXXXXX.png");
tmp.open();
region_map_[id] = tmp.fileName();
tmp.setAutoRemove(false);
io::magick::save(ima, tmp.fileName().toStdString());
}
else
io::magick::save(ima, QString(output_dir_ + id + ".png").toStdString());
}
region = region.nextSibling();
}
......
......@@ -36,15 +36,15 @@ class ImageCrop : public QObject
Q_OBJECT
public:
ImageCrop(QString xml, QString img, QString output);
ImageCrop(QString, QString, QString);
~ImageCrop();
void save_image(QString file = QString::Null());
bool crop_regions();
void save_image(QString);
bool crop_regions(bool temp = false);
QString img_to_base64();
bool img_from_base64(QString str, QString img_name, QString mime);
void to_base64(QString out_file, bool no_crop);
bool img_from_base64(QString, QString);
void to_base64(QString, bool);
void from_base64();
......@@ -52,6 +52,7 @@ private:
QString xml_;
QString image_;
QString output_dir_;
QMap<QString, QString> region_map_;
};
#endif /* !IMAGE_CROP_HH */
#include <iostream>
#include <QDomDocument>
#include <string>
#include <string>
#include <cstdlib>
#include "xml_transform.hh"
int main(int argc, char **argv)
......@@ -8,60 +10,109 @@ int main(int argc, char **argv)
std::string man;
man = "xml_transform\n"
"OPTIONS:\n\n"
"HTML output:\n"
"\t--html <xml> <ppm> <out_dir> : HTML output with non-text regions cropped into many png files.\n"
"\t--html-base64 <xml> <out_dir> : HTML output from a container XML file.\n\n"
"\t\033[01m--html\033[00m\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput.html\033[00m"
"\t\t\tCreates HTML file, images are embedded inside in base 64 format.\n"
"\t\033[01m--html-base64\033[00m \033[04minput.xml\033[00m \033[04moutput.html\033[00m"
"\t\t\tSame as --html but input is a XML file with images encoded in base 64 inside.\n"
"\t\033[01m--html-full\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput_dir\033[00m"
"\t\t\tCreates HTML file without converting images in base 64. Images + HTML file are placed in output_dir.\n\n"
"PDF output:\n"
"\t--pdf <xml> <ppm> <out_dir> : PDF output with non-text regions cropped into many png files.\n"
"\t--pdf-no-crop <xml> <ppm> <out_dir>: PDF output with the entire picture displayed over the text.\n"
"\t--pdf-base64 <xml> <out_dir> : PDF output from a container XML file.\n"
"\t--pdf-base64-no-crop <xml> <ppm> <out_dir> : PDF with the entire picture displayed over the text, the picture is loaded from a container XML file.\n\n"
"SVG output:\n"
"\t--svg <xml> <out_dir> : SVG output (works only with base 64 xml encoded.\n\n"
"Base 64 operations:\n"
"\t--to-base64 <xml> <ppm> <out_xml> : Produces a container XML file by converting cropped pictures into base 64 format.\n\n"
"\t\033[01m--pdf\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput.pdf\033[00m"
"\t\t\tCreates PDF file, images are embedded inside in base 64 format.\n"
"\t\033[01m--pdf-base64\033[00m \033[04minput.xml\033[00m \033[04moutput.pdf\033[00m"
"\t\t\tSame as --pdf but input is a XML file with images encoded in base 64 inside.\n\n"
"SVG output (experimental, may not work with all files):\n"
"\t\033[01m--svg\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput.svg\033[00m"
"\t\t\tCreates SVG file, images are embedded inside in base 64 format.\n"
"\t\033[01m--svg-base64\033[00m \033[04minput.xml\033[00m \033[04moutput.svg\033[00m"
"\t\t\tSame as --svg but input is a XML file with images encoded in base 64 inside.\n\n"
"OpenDocument output:\n"
"\t--open <xml> <ppm> <out_dir> : OpenDocument output (odt, odf).\n\n"
"\t\033[01m--oo-doc\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput.odt\033[00m"
"\t\t\tCreates Open Document Writer (odt) file.\n\n"
"Base 64 operations:\n"
"\t--to-base64 <xml> <ppm> <out_xml> : Produces a container XML file by converting cropped pictures into base 64 format.\n"
"\t--to-base64-no-crop <xml> <ppm> <out_xml> : Same as to-base64 but only the picture is converted in base 64.\n"
"\t--from-base64 <xml> <out_dir> : Decodes a XML container file to produce original image files.\n\n"
"For PDF/HTML/SVG/OD output, Bourne shell scripts are provided to produce the outputs, just run sh *_generator.sh \n"
"\t\033[01m--to-base64\033[00m \033[04minput.xml\033[00m \033[04mimage\033[00m \033[04moutput.xml\033[00m"
"\t\t\tCreates a container XML file. It will contain regions which are cropped and converted in base 64.\n"
"\t\033[01m--to-base64-no-crop\033[00m \033[04minput.xml\033[00m \033[04image\033[00m \033[04moutput.xml\033[00m"
"\t\tSame as --to-base64 but only the full picture will be converted, regions are not cropped\n"
"\t\033[01m--from-base64\033[00m \033[04minput.xml\033[00m \033[04moutput_dir\033[00m"
"\t\t\tDecodes a XML file which has been encoded in base 64, regions will be converted into png files and saved in output_dir.\n\n"
"Requirements:\n"
"PDF : fop >= 0.95\n"
"HTML : xsltproc\n"
"SVG : trunk version of fop\n"
"OpenDocument : ooconvert";
"OpenDocument : ooconvert (included)";
if (argc > 4)
{
std::string html = "--html";
std::string open = "--open";
std::string html_full = "--html-full";
std::string open = "--oo-doc";
std::string pdf = "--pdf";
std::string pdf_no_crop = "--pdf-no-crop";
std::string svg = "--svg";
std::string to_base64 = "--to-base64";
std::string to_base64nocrop = "--to-base64-no-crop";
if (html.compare(argv[1]) == 0)
if (html_full.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], argv[3], argv[4]);
xmlt.createHTML(false);
QString cmd = "sh templates/xml_transform.sh html " + xmlt.out() + "output.xml " + xmlt.out() + "output.html";
return system (cmd.toAscii().constData());
}
else if (html.compare(argv[1]) == 0)
{
QTemporaryFile tmp;
tmp.open();
tmp.fileName();
XmlTransform xmlt(argv[2], argv[3], QString::Null(), tmp.fileName());
xmlt.toBase64(false);
QString cmd = "sh templates/xml_transform.sh html-base64 " + tmp.fileName() + " " + argv[4];
return system (cmd.toAscii().constData());
}
else if (pdf.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], argv[3], argv[4]);
xmlt.createPDF(true, false);
QTemporaryFile tmp;
tmp.open();
tmp.fileName();
XmlTransform xmlt(argv[2], argv[3], QString::Null(), tmp.fileName());
xmlt.toBase64(false);
QString cmd = "sh templates/xml_transform.sh pdf " + tmp.fileName() + " " + argv[4];
return system (cmd.toAscii().constData());
}
else if (open.compare(argv[1]) == 0)
else if (svg.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], argv[3], argv[4]);
xmlt.createOpen();
QTemporaryFile tmp;
tmp.open();
tmp.fileName();
XmlTransform xmlt(argv[2], argv[3], QString::Null(), tmp.fileName());
xmlt.toBase64(false);
QString cmd = "sh templates/xml_transform.sh svg " + tmp.fileName() + " " + argv[4];
return system (cmd.toAscii().constData());
}
else if (pdf_no_crop.compare(argv[1]) == 0)
else if (open.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], argv[3], argv[4]);
xmlt.createPDF(false, false);
QString dir = QDir::tempPath() + "/xml_transform." + argv[4];
XmlTransform xmlt(argv[2], argv[3], dir);
xmlt.createOpen();
QString cmd = "sh templates/xml_transform.sh oo-doc " + dir + " " + argv[4];
return system (cmd.toAscii().constData());
}
else if (to_base64.compare(argv[1]) == 0)
{
......@@ -78,31 +129,25 @@ int main(int argc, char **argv)
}
else if (argc > 3)
{
std::string pdfbase64 = "--pdf-base64";
std::string svg = "--svg";
std::string pdfbase64nocrop = "--pdf-base64-no-crop";
std::string htmlbase64 = "--html-base64";
std::string pdf_base64 = "--pdf-base64";
std::string svg_base64 = "--svg-base64";
std::string html_base64 = "--html-base64";
std::string from_base64 = "--from-base64";
if (pdfbase64.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], QString::Null(), argv[3]);
xmlt.createPDF(true, true);
}
else if (svg.compare(argv[1]) == 0)
if (svg_base64.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], QString::Null(), argv[3]);
xmlt.createSVG();
QString cmd = "sh templates/xml_transform.sh svg " + QString(argv[2]) + " " + QString(argv[3]);
return system (cmd.toAscii().constData());
}
else if (pdfbase64nocrop.compare(argv[1]) == 0)
else if (pdf_base64.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], QString::Null(), argv[3]);
xmlt.createPDF(false, true);
QString cmd = "sh templates/xml_transform.sh pdf " + QString(argv[2]) + " " + QString(argv[3]);
return system (cmd.toAscii().constData());
}
else if (htmlbase64.compare(argv[1]) == 0)
else if (html_base64.compare(argv[1]) == 0)
{
XmlTransform xmlt(argv[2], QString::Null(), argv[3]);
xmlt.createHTML(true);
QString cmd = "sh templates/xml_transform.sh html-base64 " + QString(argv[2]) + " " + QString(argv[3]);
return system (cmd.toAscii().constData());
}
else if (from_base64.compare(argv[1]) == 0)
{
......
#!/bin/sh
xsltproc xsl.xsl output.xml > output.html
\ No newline at end of file
......@@ -6,7 +6,37 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SCRIBO</title>
<link rel="stylesheet" type="text/css" href="css.css" />
<style type="text/css">
.line
{
position:absolute;
z-index:7;
display:inline;
white-space:pre;
<!-- FIXME -->
letter-spacing:-2px;
padding:0px;
margin:0px;
font-family:"Times New Roman", Times, serif;
}
.para
{
position:absolute;
z-index:6;
}
.region
{
position:absolute;
z-index:5;
}
.image
{
position:absolute;
border:0;
}
</style>
</head>
<body>
......@@ -129,10 +159,8 @@
</xsl:choose>
</xsl:variable>
<div class="line" onmouseover="this.style.opacity=0.2;this.filters.alpha.opacity=20"
onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100">
<div class="line">
<xsl:attribute name="style">
opacity:1;
height:auto;
font-size:<xsl:value-of select="$a+$d" />px;
width:<xsl:value-of select="$x2 - $x1" />px;
......@@ -146,7 +174,7 @@
<!-- ENF OF TEXT LINE -->
<!-- TEXT REGION -->
<xsl:if test="name() = 'text_region'">
<!-- <xsl:if test="name() = 'text_region'">
<div class="region">
<xsl:attribute name="style">
height:<xsl:value-of select="$y2 - $y1" />px;
......@@ -155,11 +183,11 @@
top:<xsl:value-of select="$y1" />px;
</xsl:attribute>
</div>
</xsl:if>
</xsl:if>-->
<!-- ENF OF TEXT REGION -->
<!-- PARAGRAPH -->
<xsl:if test="name() = 'paragraph'">
<!-- <xsl:if test="name() = 'paragraph'">
<div class="para">
<xsl:attribute name="style">
height:<xsl:value-of select="$y2 - $y1" />px;
......@@ -168,7 +196,7 @@
top:<xsl:value-of select="$y1" />px;
</xsl:attribute>
</div>
</xsl:if>
</xsl:if>-->
<!-- ENF OF PARAGRAPH -->
<!-- NON-TEXT REGIONS -->
......@@ -209,7 +237,7 @@
<xsl:attribute name="height">
<xsl:value-of select="$y2 - $y1" />