Re: [xml] question regarding error reporting



Well, this really changes the existing APIs a lot. I get tons of regression
test errors which to me means it is a change of behaviour in some of
the most common error paths. The introduction of the structured error
handlers was sneaked in such a way to not modify the common error handling
paths. I'm afraid your patch is too intrusive to be applied as-is.
I also spotted an incoherency the XPointer errors are flagged as being
parser ones.
I enclosed the logs of "make tests" on my machine.

Many of the regression test results have errors in them, they would just need
to be updated with the new output that has the file name / line number / etc. 
To me it isn't really a breakage but an enhancement that happens to require
updating the regression test outputs for those that expect error messages.  For
example here is the difference in output of the first regression test failure
your log identified:

With my change:
C:\gsstools\third-party\gnome-xml\win32\bin.msvc>testsax ../../test/ent2
SAX.setDocumentLocator()
SAX.startDocument()
SAX.internalSubset(EXAMPLE, , example.dtd)
SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
SAX.getEntity(xml)
SAX.entityDecl(title, 2, -//MY-TITLE//FR, title.xml, (null))
SAX.unparsedEntityDecl(image, (null), img.gif, GIF)
SAX.externalSubset(EXAMPLE, , example.dtd)
SAX.startElement(EXAMPLE)
SAX.characters(
  , 3)
SAX.getEntity(title)
SAX.error: ../../test/ent2:8: parser error : Entity 'title' not defined
  &title;
         ^
SAX.characters(
  This text is about XML, the, 31)
SAX.getEntity(xml)
SAX.characters(Extensible Markup Language, 26)
SAX.reference(xml)
SAX.characters( and this is an embedded , 25)
SAX.startElement(IMG, src='image')
SAX.endElement(IMG)
SAX.characters(
, 1)
SAX.endElement(EXAMPLE)
SAX.endDocument()

Before my change:
C:\gsstools\third-party\gnome-xml\win32\bin.msvc>testsax ../../test/ent2
SAX.setDocumentLocator()
SAX.startDocument()
SAX.internalSubset(EXAMPLE, , example.dtd)
SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
SAX.getEntity(xml)
SAX.entityDecl(title, 2, -//MY-TITLE//FR, title.xml, (null))
SAX.unparsedEntityDecl(image, (null), img.gif, GIF)
SAX.externalSubset(EXAMPLE, , example.dtd)
SAX.startElement(EXAMPLE)
SAX.characters(
  , 3)
SAX.getEntity(title)
SAX.error: Entity 'title' not defined
SAX.characters(
  This text is about XML, the, 31)
SAX.getEntity(xml)
SAX.characters(Extensible Markup Language, 26)
SAX.reference(xml)
SAX.characters( and this is an embedded , 25)
SAX.startElement(IMG, src='image')
SAX.endElement(IMG)
SAX.characters(
, 1)
SAX.endElement(EXAMPLE)
SAX.endDocument()

C:\gsstools\third-party\gnome-xml\win32\bin.msvc>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]