<div dir="ltr"><div><font color="#000000" face="arial, sans-serif">Hi , </font></div><div><font color="#000000" face="arial, sans-serif"><br></font></div><div><font color="#000000" face="arial, sans-serif">As you said :</font></div>
<div><font color="#cc0000"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></font></div><font color="#cc0000"><span style="font-family:arial,sans-serif;font-size:13px">"If you look at content.xml file, it contains table/column definitions.</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">The database/script file you're mentioning contains HSQLDB or other</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">backend-specific SQL (yes, there's no respected standard). I am</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">guessing the xml is easier to parse than the specific SQL. "</span></font><br style="font-family:arial,sans-serif;font-size:13px"><div><br></div><div>I tried to parse content.xml but the problem which I faced is that content.xml does not contain every information.For e.g the samples downloaded from source provided by you ( <a href="http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html" target="_blank" style="font-size:13px;font-family:arial,sans-serif">http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html</a> ) had a file under name "cons2.odb" in which by simply analyzing (after unziping .odb file) content.xml file , we don't gets necessary information regarding- Primary key and other constraints, and also for some tables it doesn't states any column at all which are originally present there in database.And regarding tuples (i.e instances or values or data) its present in "file_name/database/data" file but under some encoded scheme (till now I couldn't found out the scheme,as I haven't thought of it much).So considering above issues I think I will have to parse script file only (though a little more information can be gathered from setting.xml but that will not sufficient) .</div>
<div>If possible , I would like to have your views about my approach and suggestions towards it.</div><div><br></div><div>Regards</div><div>Jayesh Hathila</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Feb 20, 2014 at 6:02 AM, Jaroslaw Staniek <span dir="ltr"><<a href="mailto:staniek@kde.org" target="_blank">staniek@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 19 February 2014 22:21, Jayesh Hathila <<a href="mailto:sharma.jayesh52@gmail.com">sharma.jayesh52@gmail.com</a>> wrote:<br>
> Hi,<br>
</div><div class="">> ( In addition to my previous mail )<br>
> I am attaching perl script which unzips the .odb format.The script will<br>
> create a folder with the same name as .odb file except extension (e.g<br>
> file.odb converts to file folder).After unzipping till now I have been able<br>
> to get the query about tables in file named script in<br>
> /file/database/script path which can be directly used in kexi.Please have a<br>
> look at the code and if possible reply any error you found in the approach .<br>
<br>
<br>
</div>This is a good and needed step in analyzing the odb format.<br>
<br>
In ODF filters development I've been using such an 'unxml' script:<br>
<br>
------8x-----------<br>
#!/bin/bash<br>
unzip -o "$1" || exit 1<br>
for f in `find . -name \*.xml* -o -name .rels | grep -v -e "\.svn$" -e<br>
"\.svn/"` ; do<br>
xmllint --format "$f" --output "$f"<br>
done<br>
------8x-----------<br>
<br>
In addition to uncompressing it reformats the xml files to make them<br>
human-readable.<br>
<br>
In the actual code<br>
<br>
PS: Sample .odb databases are available eg at<br>
<a href="http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html" target="_blank">http://www.floppybunny.org/robin/web/virtualclassroom/chap8/libreoffice_base.html</a>.<br>
<br>
If you look at content.xml file, it contains table/column definitions.<br>
The database/script file you're mentioning contains HSQLDB or other<br>
backend-specific SQL (yes, there's no respected standard). I am<br>
guessing the xml is easier to parse than the specific SQL.<br>
<br>
PS2: In the actual C++ implementation, KoOdfReadStore class from<br>
calligra libs can be used to read contents of the .odb.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
--<br>
regards / pozdrawiam, Jaroslaw Staniek<br>
Kexi & Calligra & KDE | <a href="http://calligra.org/kexi" target="_blank">http://calligra.org/kexi</a> | <a href="http://kde.org" target="_blank">http://kde.org</a><br>
Qt for Tizen | <a href="http://qt-project.org/wiki/Tizen" target="_blank">http://qt-project.org/wiki/Tizen</a><br>
Qt Certified Specialist | <a href="http://www.linkedin.com/in/jstaniek" target="_blank">http://www.linkedin.com/in/jstaniek</a><br>
_______________________________________________<br>
calligra-devel mailing list<br>
<a href="mailto:calligra-devel@kde.org">calligra-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/calligra-devel" target="_blank">https://mail.kde.org/mailman/listinfo/calligra-devel</a><br>
</div></div></blockquote></div><br></div>