<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/109393/">http://git.reviewboard.kde.org/r/109393/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/109393/diff/5/?file=120719#file120719line91" style="color: black; font-weight: bold; text-decoration: underline;">filters/libodftraverse/OdfTraverserContext.h</a>
<span style="font-weight: normal;">
(Diff revision 5)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">91</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * name is the name of the metadata tag</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is the name e.g. dc:title or the full QName
{http://purl.org/dc/elements/1.1/}title
You could use QPair<QString,QString> as key. Unfortunately Qt has no class like
http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/namespace/QName.html</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/109393/diff/5/?file=120719#file120719line109" style="color: black; font-weight: bold; text-decoration: underline;">filters/libodftraverse/OdfTraverserContext.h</a>
<span style="font-weight: normal;">
(Diff revision 5)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">109</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">QHash</span><span class="o"><</span><span class="n">QString</span><span class="p">,</span> <span class="n">QString</span><span class="o">></span> <span class="n">manifest</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is a file listed here guaranteed to be here or are you simple returning
manifest:file-entry/@manifest:full-path
and
manifest:file-entry/@manifest:media-type
?</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/109393/diff/5/?file=120719#file120719line120" style="color: black; font-weight: bold; text-decoration: underline;">filters/libodftraverse/OdfTraverserContext.h</a>
<span style="font-weight: normal;">
(Diff revision 5)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">120</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * size is the size in points.</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">How do you determine size for svg files?
</pre>
</div>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Interesting approach to the common case of writing an export filter. I have a few comments and ideas on the problem and the approach.
Usually one would use XSLT to convert one xml format to another. However in ODF, there is a lot of context which is not easily available.
Nevertheless, in XSLT one has the e.g. XPath expression
"document('styles.xml')//styles:styles" to list all the styles
or
"document('styles.xml')//manifest:file-entry" to list all files from the manifest
Getting image sizes is tricky though. They'd need to be put in a temporary xml file which is available to the xslt.
If you go with the C++ approach, you could try to be complete. Currently, the list of available tags is whatever you think is useful and should be expanded whenever you want to support more. Another approach could be to parse the relax ng and generate the code like explained in
http://lists.kde.org/?l=calligra-devel&m=130768698325584
As it currently stands, the TraversalBackend not that much information is added on top of
QXmlContentHandler::startElement / QXmlContentHandler::endElement
except a switch for the various QNames. But you do lose the speed of a SAX parser by using KoXmlElement.
</pre>
<p>- Jos</p>
<br />
<p>On March 20th, 2013, 8:35 p.m. UTC, Inge Wallin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Calligra.</div>
<div>By Inge Wallin.</div>
<p style="color: grey;"><i>Updated March 20, 2013, 8:35 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch creates a new library in filters/odftraverse. The purpose of this library is to create classes to make it easier to create export filters for ODF files. What you do to use this library is that you inherit a base class for backends to this parser / traverser and in the many callbacks you write the output that is relevant for your output format.
To show how it can be used I have also created a very simple proof of concept filter that exports to text format, something Calligra actually lacked before.
The current implementation traverses only ODT files and there are still a number of NYI functions that I want to finish before the actual merge. But I thought I'd get some opinions early. In other words, I expect at least one, maybe two iterations before this branch can be merged.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested with a lengthy text file.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>filters/CMakeLists.txt <span style="color: grey">(bb0db3d)</span></li>
<li>filters/libodftraverse/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdfParser.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdfParser.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdfTraverserContext.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdfTraverserContext.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdtTraverser.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdtTraverser.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdtTraverserBackend.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/OdtTraverserBackend.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/libodftraverse/odftraverse_export.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/words/ascii/AsciiExport.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/words/ascii/AsciiExport.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/words/ascii/CMakeLists.txt <span style="color: grey">(d36de47)</span></li>
<li>filters/words/ascii/OdtTraverserAsciiBackend.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/words/ascii/OdtTraverserAsciiBackend.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>filters/words/ascii/TODO <span style="color: grey">(ceb1a24)</span></li>
<li>filters/words/ascii/words_ascii_export.desktop <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/109393/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>