← Back to team overview

dolfin team mailing list archive

Re: Version 0.6.0?

 

On Wed, Feb 15, 2006 at 01:55:42PM +0100, Johan Jansson wrote:
> On Tue, Feb 14, 2006 at 01:32:36PM -0600, Anders Logg wrote:
> > On Tue, Feb 14, 2006 at 07:31:29PM +0100, Johan Jansson wrote:
> > > On Mon, Feb 13, 2006 at 07:39:31PM -0600, Anders Logg wrote:
> > > ...
> > > > Maybe we can just move the writing of the header to the constructor
> > > > and the writing of the footer to the destructor of XMLFile?
> > > 
> > > Hm, can we differentiate between reading and writing at that point?
> > 
> > No, I didn't think about that. How about two new (private) functions
> > in XMLFile: writeHeader() and writeFooter() and a bool
> > header_written and just implement as
> > 
> > void XMLFile::writeHeader()
> > {
> >   if ( header_written )
> >     return;
> > 
> >   bla bla
> > 
> >   header_written = true;
> > }
> > 
> > void XMLFile::writeFooter()
> > {
> >   if ( !header_written )
> >     return;
> > 
> >   bla bla
> > }
> > 
> > All the output operators then just need to call writeHeader() and
> > writeFooter() is called by the destructor.
> > 
> 
> Ok, this is probably a good solution, I can't think of any better at least.
> 
> > ok. Do you know if libxml2 has a function you can call to verify against a
> > schema before parsing (without first building the DOM tree which may
> > not fit in memory)?
> > 
> > /Anders
> > 
> 
> Hm, this appears to be a limitation of libxml2:
> 
> http://mail.gnome.org/archives/xml/2005-January/msg00059.html
> 
> There exists other XML parsers which can do schema validation with the
> SAX model however, Xerces for example:
> 
> http://xml.apache.org/xerces-c/schema.html#usage
> 
> I guess the situation right now is that we cannot do schema validation
> for very large data files.

It would be good to have validation, but I think our current parser
(and the libxml2 SAX interface that we use) will do some kind of
validation. Each format knows that it's looking for (ignoring anything
else) and complains if something is missing.

/Anders



References