[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Detailes needed for XML-plugin implementation
From:       Adrian Lungu <adrian.lungu89 () gmail ! com>
Date:       2011-11-19 22:36:05
Message-ID: CADFtesB+MCG1hvVAJDuUSAt9tZ6AK_yLc5GZb3ejAZzAzV-AcQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Nov 19, 2011 at 2:33 PM, Milian Wolff <mail@milianw.de> wrote:

> Diana, 18.11.2011:
> > > > 2.  For the XML document formatting : We saw that
> "plugin_katexmlcheck"
> > > > uses "xmllint" application. xmllint can be used to format an xml
> > > > document, too (using "--format" argument). What would be the best
> > > > choice: using xmllint or writing the code that does the format using
> > > > the parser (KateSyntaxDocument).
> > >
> > > It depends on what you want to do: If you want to reindent the code,
> this
> > > is
> > > one way. However, it's not so good as we then depend on xmllint (which
> is
> > > probably not available on Windows or so...).
> > > So writing a small parser shoudn't be too hard. On the other hand, this
> > > exists already in the XML Tool plugin, as far as I know, and that's
> also
> > > where I would add the code to do the highlighting and so on (folder:
> > > kate/plugins/xmltools/).
> >
> > So we will tell the students to write a small parser for XML files and
> use
> > it to implement these new features.
>
> No, please don't. There are good XML parsers out there, two alone in Qt,
> and
> you should try to reuse them instead of reinventing the wheel please.
>

We didn't intend to write a new parser, but I think this is our only
choice. It is true, Qt has some XML parsers (using DOM and SAX), but these
parsers work only for correct XML files. And one objective of our plugin is
to help developers see if they are writing a valid XML file (e.g.: closing
the tags in a proper order). So we can't use those parsers. Dominik
suggested us to write it and we agreed that this should be the right way to
do it.

We are opened for others solutions too, so please let us know if you have
any ideas that might help us.

Thank you,
Adrian and Diana

[Attachment #5 (text/html)]

<br><div class="gmail_quote">On Sat, Nov 19, 2011 at 2:33 PM, Milian Wolff <span \
dir="ltr">&lt;<a href="mailto:mail@milianw.de">mail@milianw.de</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> Diana, 18.11.2011:<br>
<div class="im">&gt; &gt; &gt; 2.  For the XML document formatting : We saw that \
&quot;plugin_katexmlcheck&quot;<br> &gt; &gt; &gt; uses &quot;xmllint&quot; \
application. xmllint can be used to format an xml<br> &gt; &gt; &gt; document, too \
(using &quot;--format&quot; argument). What would be the best<br> &gt; &gt; &gt; \
choice: using xmllint or writing the code that does the format using<br> &gt; &gt; \
&gt; the parser (KateSyntaxDocument).<br> &gt; &gt;<br>
&gt; &gt; It depends on what you want to do: If you want to reindent the code, \
this<br> &gt; &gt; is<br>
&gt; &gt; one way. However, it&#39;s not so good as we then depend on xmllint (which \
is<br> &gt; &gt; probably not available on Windows or so...).<br>
&gt; &gt; So writing a small parser shoudn&#39;t be too hard. On the other hand, \
this<br> &gt; &gt; exists already in the XML Tool plugin, as far as I know, and \
that&#39;s also<br> &gt; &gt; where I would add the code to do the highlighting and \
so on (folder:<br> &gt; &gt; kate/plugins/xmltools/).<br>
&gt;<br>
&gt; So we will tell the students to write a small parser for XML files and use<br>
&gt; it to implement these new features.<br>
<br>
</div>No, please don&#39;t. There are good XML parsers out there, two alone in Qt, \
and<br> you should try to reuse them instead of reinventing the wheel please.<br><div \
class="im"></div></blockquote><div><br><span dir="ltr" id=":1v8">We didn&#39;t intend \
to write a new parser, but I  think this is our only choice. It is true, Qt has some \
XML parsers  (using DOM and SAX), but these parsers work only for correct XML files. 
And one objective of our plugin is to help developers see if they are 
writing a valid XML file (e.g.: closing the tags in a proper order). So 
we can&#39;t use those parsers. Dominik suggested us to write it and we 
agreed that this should be the right way to do it.<br><br>We are opened for others \
solutions too, so please let us know if you have any ideas that might help \
us.<br><br>Thank you,<br>Adrian and Diana</span><br> </div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic