[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: simple XML for C++ application data-file I/O
FWIW, I ended up having different (sub)DocHandlers for the different nesting levels and implementing a Handler stack to push/pop them according to the tags they handled. At least this way you can handle sub-trees fairly simply, and reduce the bulk of code required for situations where you have many tags identifying different sub-trees (and hence semantics). A (minor) problem I had with this was that I looked up the Handlers based on the tag-name - so there's a problem when the same tag is used in different 'contexts'. It would be useful to associate a Handler with a given tag at the parser initialisation level, using some XPath notation to identify the appropriate tag(s). tim > -----Original Message----- > From: Paul Miller [mailto:stele@f...] > Sent: 06 December 1999 15:11 > To: xml-dev > Subject: Re: simple XML for C++ application data-file I/O > > > > We tried to keep SAX 1.0 as simple as possible -- how would you > > simplify the following further? > > > > public void startElement (String name, AttributeList atts) > > { > > // do something!! > > } > > Here is where I have the problem. This leaves an awful lot up to the > application, still, including handling the proper nesting. I > would like > to make the actual parsing of elements more "automatic", so when a > certain element is hit, it calls a function with my object > pointer where > I can pick up the parsing from there, then drop back out to the > enclosing XML scope and keep going. > > Perhaps what I want to do should be built on SAX instead of expat, > though. > > -- > 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...) > ********************************************************************* The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Capital Markets Company. http://www.capitalmarketscompany.com *********************************************************************** 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
|