[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML parsing memory overhead concerns

  • From: Paul Miller <stele@f...>
  • To: "Clark C. Evans" <clark.evans@m...>
  • Date: Fri, 17 Dec 1999 09:24:05 -0500

overhead xml
> Thanks James.  I think I got it.  You use the
> expat events to build the queue, and the use
> the call-backs to process the queue.  When
> the queue is empty, you ask expat to load
> the queue with the next chunk of the source.
> This should work like a charm -- and in a
> single thread.
> 
> Oh How Pretty!

Yes, I think so. This sounds exactly like what I was trying to do.
Perhaps my implementation was flawed. The problem occurred when I got to
some element data and wanted to "pull" that from within an element
handler.

Say I get called for an element "Point" which has this syntax:

	<Point>(x,y)</Point>

When I get to the handler, I'd like to write this:

void PointHandler(XML::Element &elem, Point *point)
{
	// "pull" a chunk of element data, but it'll automatically
	// stop when it gets to the end of the element (it stops
	// when it sees </Point>)
	char buf[40];
	elem.GetData(buf, sizeof(buf));
	sscanf(buf, "%dx%d", &point->x, &point->y);
}

For some reason I couldn't figure out how to make this work, because
with expat I might have hit the element but not necessary gotten to the
character data handler.

I think this will make a lot more sense once I release the code. And
fortunately, I could rewrite the internals (once I figure out how) to
once again layer over expat, without changing the interface.

--
Paul Miller - stele@f...

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.