OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: simple XML for C++ application data-file I/O

[ Lists Home | Date Index | Thread Index ]
  • From: Shaw Tim <tshw@capitalmarketscompany.com>
  • To: xml-dev <xml-dev@ic.ac.uk>
  • Date: Mon, 6 Dec 1999 16:05:48 +0100

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






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS