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

RE: expat tree-builder (dom)

  • From: Andy Dent <dent@o...>
  • To: Doug Forman <dforman@t...>
  • Date: Sat, 29 Jan 2000 13:08:29 +0800

expat tree builder dom c
Hi Doug
>Since my post, I was pressured to produce something, so I built something
>that sounds similar... a limitted  C++ wrapper around expat with utilities
>to configure the callbacks for you and collect tags and attributes interest.
The main added benefit of expatpp is the "sub-parser" model.

Parsing our report files is quite complex as we can nest multiple reports
within a single file and each report has independent
- report layout
- text styles attached to layout items
- adorners - serialised user code with user-saved data and signatures so
people can have
  shaders with their own logic.
- database schema
- data to import into the schema

Debugging this nested set of tags looked like a nightmare so I put a bit of
time into the sub-parser model. The static methods which are the callbacks
automatically handle the nesting depth so will return from the sub-parser
when it reaches its end tag. This vastly simplifies what the sub-parser has
to do. If it only needs to know a couple of tags within its domain then
that's all it evaluates in the startElement etc.

That also improves efficiency because you can optimise the checking of tags
for the most probable in a small locale. Our layout parser knows that it
will encounter <box> tags (CSS term used here to describe a box in which
<inline> elements are laid out) more often than others so can check for
them first.

With the sub-parsers having such limited domains we also are able to check
our output code rigorously by putting lots of asserts in the sub-parsers.

Andy Dent BSc MACS AACM, Software Designer, A.D. Software, Western Australia
OOFILE - Database, Reports, Graphs, GUI for c++ on Mac, Unix & Windows
PP2MFC - PowerPlant->MFC portability
http://www.oofile.com.au/

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/ or CD-ROM/ISBN 981-02-3594-1
Unsubscribe by posting to majordom@i... the message
unsubscribe xml-dev  (or)
unsubscribe xml-dev your-subscribed-email@your-subscribed-address

Please note: New list subscriptions now closed in preparation for transfer to OASIS.



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.