On Mon, 2005-08-29 at 13:30 +0200, Bjoern Hoehrmann wrote: > * Emmanuel Saracco wrote: > >I am using libcroco to validate CSS stylesheets. Is there a way to tell > >it to be more verbose and retrieve warnings and errors in a buffer > >instead of standard output? > > This is not currently possible, the routines and data structures for > this are private to the parser and the code that dumps the errors to > stderr is called unconditionally.
To achieve this I had sightly modified libcroco - 0.6.0 - to be used in CSSED as CSS validator, just making the error structure public and modifying the SAC error handler so it's called with a line number. The error stack is available at the end of parsing - throught an added function cr_parser_get_error_stack() - so you can get it to show those errors to the user if something goes wrong. The error stack is cleaned on parser's destroy. http://cvs.sourceforge.net/viewcvs.py/cssed/cssed/libcroco/parser/ Modified files: cr_parser.c cr-tknzr.h cr-tknzr.c cr-doc-handler.c cr-doc-handler.h Implementation: http://cvs.sourceforge.net/viewcvs.py/cssed/cssed/src/cssparser.c? rev=1.14&view=markup Unfortunately as it's modified it's no libcroco anymore ... -- Iago Rubio _______________________________________________ Libcroco-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/libcroco-list
