On Mon, Sep 29, 2003 at 08:03:27PM +0100, Graham Bennett wrote:
> On Fri, Sep 26, 2003 at 04:36:55AM -0400, Daniel Veillard wrote:
> > The question is purely at the new SAX2 API:
> > - currently defaulted attributes are always reported
> > - there is a number of defaulted attribute indication allowing
> > to discard them if not needed on top of the SAX2 API
> > But the current behaviour could be reversed and the defaulted attributes
> > could be shown only if the XML_PARSE_DTDATTR option is required.
>
> >From the point of view of my application (and many others I imagine), I
> only care about the final value of the attribute. So I would prefer it
> if it remained the way it is, it seems like the most logical default
> behaviour.
Hum, this might be a misunderstanding, libxml2 new SAX2 shows defaulted
attributes only if they are effectively defaulted, i.e. they are not
in the input element stream but are marked as #FIXED in the DTD.
The previous SAX1 simply didn't reported them, and currently SAX2
report those but allows to ignore them by specifying how many attributes
were defaulted (and they show up as last items in the array passed in
the callback).
If the attribute is in the input stream the value from the DTD is not
reported at that level.
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard@xxxxxxxxxx | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
|