<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 02/24/2011 05:54 AM, Thomas Heute wrote:
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <br>
      Nick, Julien, Alain,<br>
      <br>
      As said before we'd like to harmonize the XML parsing accross the
      GateIn projects. Let's kill this once for all...<br>
      <br>
      It doesn't mean we would change the existing parsers overnight but
      it means we will impose a way for any new parsing (or when we
      decide to rewrite a parser).<br>
      <br>
      If we need parser tools, they will go in Common module ultimately.
      There might be a phase when the code will be duplicated (as Nick's
      tools need to work on an untouched portal where upgrading common
      is not an option).<br>
      <br>
      We already agreed that StAX as a base was the way to go, I hope we
      still agree ;)<br>
    </blockquote>
    <br>
    I think we're in agreement that StAX is the way to go if we're
    focusing on pure performance.<br>
    <br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> <br>
      Let's separate in reading/writing XML (doesn't necessarily
      necessarily mean marhalling/unmarshalling BTW) and agree on both.<br>
      <br>
      Reading XML:<br>
      &nbsp;&nbsp;&nbsp; Option 1:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Plain StAX, JBoss AS 7 uses that (in fact they use StAX
      Mapper, a very lightweight library made by the JBoss AS7 team. <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="https://github.com/jbossas/staxmapper/">https://github.com/jbossas/staxmapper/</a>
      which only helps to work with multiple namespaces + some little
      helpers for ignoring part of the file, format the XML when
      writing...)<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; One example of JBoss AS 7 parsing file: <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://github.com/emuckenhuber/jboss-as/blob/master/web/src/main/java/org/jboss/as/web/WebSubsystemParser.java">https://github.com/emuckenhuber/jboss-as/blob/master/web/src/main/java/org/jboss/as/web/WebSubsystemParser.java</a><br>
    </blockquote>
    <br>
    Since we've already invested some time to write some code around
    stax, I think we agree on something that will benefit GateIn.<br>
    <br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> &nbsp;&nbsp;&nbsp;
      Option 2:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Nick's stuff (please explain advantages/drawbacks)<br>
    </blockquote>
    <br>
    The API isn't quite intuitive.&nbsp; Once you get used to it, it's fairly
    easy to write and maintain.&nbsp; A lot of the use cases that
    stax-builder provided (reading wise) I think are supported in
    staxnav, which has a simplified API.&nbsp; I'm good scratching this
    (reader part) especially if we can solve the issue I mention below
    about staxnav.<br>
    <br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> &nbsp;&nbsp;&nbsp;
      Option 3:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Julien/Alain's stuff (please explain advantages/drawbacks)<br>
    </blockquote>
    <br>
    API is nice to use, makes sense for most xml parsing.&nbsp; One issue I
    have is that it does save content in memory, even after navigation
    is successful.&nbsp; I propose we discard all history after a successful
    navigation.&nbsp; I'll look into a solution for this.<br>
    <br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> <br>
      Writing XML:<br>
      &nbsp;&nbsp;&nbsp; Option 1:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Plain StAX (well-formed guaranteed over plain Writer)<br>
      &nbsp;&nbsp;&nbsp; Option 2:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Nick's stuff (please explain advantages/drawbacks)<br>
    </blockquote>
    <br>
    Has formatting writer, can chain writes, easy to use.<br>
    <br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> &nbsp;&nbsp;&nbsp;
      Option 3:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Julien/Alain's stuff (please explain advantages/drawbacks)<br>
    </blockquote>
    <br>
    No writing capabilities.<br>
    <blockquote cite="mid:4D6638F0.40703@redhat.com" type="cite"> <br>
      Note that there are other utilities and frameworks based on StAX:<br>
      &nbsp;&nbsp;&nbsp; Stax-Utils: <a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://stax-utils.dev.java.net/">http://stax-utils.dev.java.net/</a><br>
      &nbsp;&nbsp;&nbsp; StaxMate: <a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://wiki.fasterxml.com/StaxMateHome">http://wiki.fasterxml.com/StaxMateHome</a><br>
      &nbsp;&nbsp;&nbsp; Apache Axiom: <a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://ws.apache.org/commons/axiom/">http://ws.apache.org/commons/axiom/</a><br>
      &nbsp;&nbsp;&nbsp; <br>
      Thomas<i><br>
      </i> </blockquote>
    <br>
    So to summarize, I am leaning towards combining these efforts as
    we've previously mentioned as long as we don't introduce any
    performance or maintenance issues as opposed to using plain stax.<br>
    <br>
    - Nick<br>
    <br>
  </body>
</html>