You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2002/03/15 06:12:09 UTC

Using APR-util's expat

On Thu, Mar 14, 2002 at 12:12:04PM -0800, Greg Stein wrote:
> These bugs have all been fixed in recent versions of Expat (the expat-lite
> directory is derived from Expat 1.1). The best thing that we could do would
> be to use the Expat provided by or found by apr-util.

I tried to take a look a few weeks ago as to what this would take,
and it doesn't look pretty because APR-util's XML routines aren't
exposing enough of the expat API to make the transition easy (i.e.
no ability to substitute handlers).  And, I'm not familiar enough
with SVN's XML usage to be able to rip it all out and switch it to
use APR-util's API.

I imagine whenever I get "free time" I could try to track down the
necessary knowledge, but it seems like this calls for someone with
a bit better knowledge of how SVN uses XML.  -- justin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Using APR-util's expat

Posted by Greg Stein <gs...@lyra.org>.
I talked about using the Expat located by apr-util, *not* about using
apr_xml. Two very different things.

The basic point is that apr-util will find Expat on the system. All we need
is to export enough info so that other apps can use it, too.

Cheers,
-g

On Sun, Mar 17, 2002 at 04:00:07PM -0600, Karl Fogel wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
> > Hmmm, interesting.  I just skimmed apr_xml.h, and indeed, it's a
> > different approach.  Subversion defines expat callbacks that do
> > specific "work" for each tag as the parse is in progress.  But the APR
> > method is to parse the whole document into memory, and then hand the
> > whole linked list of structures over to your program.
> > 
> > I guess this wouldn't be *such* a big change.  I mean, we'd just need
> > to write a a single routine that walks a fully parsed XML-document
> > structure, and calls our existing callbacks!
> 
> Hmmm, is this desirable, though?  We've compromised in the past and
> read entire structures into memory to save the development time
> associated with a streamy approach, but this would be the first time
> we actually "regressed" streamy code to become in-memory code. :-)
> 
> Shouldn't we prefer an XML parser that at least *can* work streamily,
> even if we don't always use it that way?
> 
> -K
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Using APR-util's expat

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Ben Collins-Sussman <su...@collab.net> writes:
> Hmmm, interesting.  I just skimmed apr_xml.h, and indeed, it's a
> different approach.  Subversion defines expat callbacks that do
> specific "work" for each tag as the parse is in progress.  But the APR
> method is to parse the whole document into memory, and then hand the
> whole linked list of structures over to your program.
> 
> I guess this wouldn't be *such* a big change.  I mean, we'd just need
> to write a a single routine that walks a fully parsed XML-document
> structure, and calls our existing callbacks!

Hmmm, is this desirable, though?  We've compromised in the past and
read entire structures into memory to save the development time
associated with a streamy approach, but this would be the first time
we actually "regressed" streamy code to become in-memory code. :-)

Shouldn't we prefer an XML parser that at least *can* work streamily,
even if we don't always use it that way?

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Using APR-util's expat

Posted by Ben Collins-Sussman <su...@collab.net>.
Justin Erenkrantz <je...@ebuilt.com> writes:

> On Thu, Mar 14, 2002 at 12:12:04PM -0800, Greg Stein wrote:
> > These bugs have all been fixed in recent versions of Expat (the expat-lite
> > directory is derived from Expat 1.1). The best thing that we could do would
> > be to use the Expat provided by or found by apr-util.
> 
> I tried to take a look a few weeks ago as to what this would take,
> and it doesn't look pretty because APR-util's XML routines aren't
> exposing enough of the expat API to make the transition easy (i.e.
> no ability to substitute handlers).  And, I'm not familiar enough
> with SVN's XML usage to be able to rip it all out and switch it to
> use APR-util's API.

libsvn_wc uses expat to read/write the 'entries' file, as well as
journaled log files.  libsvn_delta uses expat to read/write our
xml-patch format.  libsvn_ra_dav needs to read/write xml repsonses
over the network.  (And mod_dav_svn is already using apr_xml.h instead
of expat.)

Hmmm, interesting.  I just skimmed apr_xml.h, and indeed, it's a
different approach.  Subversion defines expat callbacks that do
specific "work" for each tag as the parse is in progress.  But the APR
method is to parse the whole document into memory, and then hand the
whole linked list of structures over to your program.

I guess this wouldn't be *such* a big change.  I mean, we'd just need
to write a a single routine that walks a fully parsed XML-document
structure, and calls our existing callbacks!

Do you agree, Herr Stein?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org