Re: libxml1 in gnome 1.4



On Sat, Mar 24, 2001 at 06:20:54PM -0800, Maciej Stachowiak wrote:
> Daniel Veillard <veillard redhat com> writes:
> 
> >  I was left with the only choice of providing both parsers in a libxml1
> > release. 
> 
> I think the idea of providing both parsers is great.

  Good,

> >     - changed the inititialization code to make the old 1.8.11 XML
> >       parser being used by default, but allowing environment variables
> >       LIBXML_USE_NEW_PARSER and LIBXML_USE_OLD_PARSER to override the
> >       default value.
> 
> This sounds dangerous, I think we should leave it to the application
> programmer what parser to use, not the user, but it dos not really
> break compat so I don't object.

  Sounds to me the only way to check whether a given app will work
with the new setting and in a given environment. Anyway this is checked
only once the first time xmlInitParser() is called, and hence can be
overriden by application developers.

> >    - I may need to add a way to call the old parser even if for apps which
> >      switched to the new one in order to allow to load old config files
> 
> Yes, or in case not all libraries are updated to use the new code on
> the same schedule.

  Well if an application developper is sure that his application will
work fine in general with the new parser then simply using:
   xmlInitParser();
   xmlUseNewParser(1);
in the main or when you are sure that no other usage of the backward
compatible mode will be needed, this will do the switch to the new parser
until the end of the application or the call to xmlCleanupParser();

  Now if it is unclear when it can switch, then it is possible to encapsulate
the calls for which you know the new parser is needed like this:

  int state;

  state = xmlUseNewParser(1);
  doc = xmlParseFile(...);
  xmlUseNewParser(state);

  The parser to use is actually stored in the parsing context, so this
scheme should not break if you use one of the more advanced APIs, basically
one just need to make sure that this is set-up when the parser is launched
(it will set up ctxt->pedantic accordingly).

> >   I honnestly think that this solution may allow a release of a new
> > libxml1 version even if done a posteriori after the final Gnome 1.4
> > release. It may not be part of the 1.4 platform but it should be part
> > of 1.4.1 and distributors should be allowed to ship it once it is
> > clear taht there is no side effects on legacy apps.
> 
> That sounds like a good plan to me.

  Perfect, the current test version need more love before being
released but at least we seems to have a solution and a plan now.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]