[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML parsing memory overhead concerns
> 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|