On Fri, May 16, 2003 at 11:20:53AM -0400, Sterling Hughes wrote:
> On Fri, 2003-05-16 at 12:41, Adam Dickmeiss wrote:
> > On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote:
> > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote:
> > > > Adam Dickmeiss <adam@indexdata.dk> wrote:
> > > >
> > > > > Default or force:) Is it possible to use system wide libxml2 for
> > > > > XML parsing in PHP?
> > > > > What options should I use?
> > > >
> > > > --with-bundle-libxml=[PATH] ?
> > > Thanks. So, must use -with-bundled when I don't want that:)
> > OK with
> > '--with-apxs=/home/adam/proj/apache/bin/apxs' \
> > '--with-bundle-libxml=/usr' \
> > '--without-bundle-expat' \
> > '--with-zlib-dir=/usr' \
> > things worked and the libphp5.so went from 7.0 MB to 3.6 MB.
> >
>
> the size of libphp5, yes. The imprint probably didn't.
I'm not an expert in this issue. Again, the real problem for
me is that YAZ uses /usr/lib/libxml2.so and if PHP has
its own version, two copies of a relatively big library
is loaded twice (bundled and system wide).
> > zlib was needed when I didn't bundle. Why?
> >
>
> Because that's how the authors of the domxml extension wanted it afaik.
> We could probably be fancier and check the libs that libxml2 was
> compiled with, and only require it as necessary.
OK.
> > Now, the first thing I notice is that
> > xml_parser_create(encoding); using libxml
> > works like
> > xml_parser_create(""); using Expat
> > as far as input encoding is concerned. So from that
> > perspective BC is breaked with libxml.
> >
>
> Err, that's not how it works in CVS at least:
>
> xml/compat.c - 279
>
> parser->parser->encoding = xmlStrdup(encoding);
Yes. That's what it does . Question is, what it means
for libxml2. Does it mean input encoding? Are you allowed
to tamper with the encoding member in the parser struct at all?
It could be that the encoding is _set_ by libxml2 to hold
the actual encoding of the XML record.. We should check
the libxml doc.
I also noticed another issue with libxml. xml_parser_create
fails for an XML record using UTF-16 encoding. That's
even more strange, because libxml does support it. At least xmllint
(part of libxml2) does not reject the XML file itself.
-- Adam
> -Sterling
>
> > -- Adam
> >
> > > -- Adam
> > >
> > > >
> > > > Moriyoshi
> > > >
> > > >
> > > >
> > > > --
> > > > PHP Internals - PHP Runtime Development Mailing List
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > > --
> > > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk
> > > Index Data T: +45 33410100 Mob.: 212 212 66
> > >
> > > --
> > > PHP Internals - PHP Runtime Development Mailing List
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk
> > Index Data T: +45 33410100 Mob.: 212 212 66
> --
> "The three most dangerous things in the world are a programmer
> with a soldering iron, a hardware type with a program patch and
> a user with an idea."
> - Unknown
--
Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk
Index Data T: +45 33410100 Mob.: 212 212 66