Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#311 error message

Feature Request
closed-fixed
Karl Waclawek
None
5
2004-07-15
2004-05-02
Anonymous
No

I use tcl tdom that uses the expat lib. I was told that
the error of xml parsing comes from the expat live
when there is parsing error I wished the error Info would
be a bit
more informative.
for example:
dom parse <test><a><b><c></c></a></test>
error "mismatched tag" at line 1 character 21
"test><a><b><c></c></a <--Error-- ></test>"

will be better if it was like microsoft explorer error:

End tag 'a' does not match the start tag 'b'. Error
rocessing
resource 'file:///C:/Documents and
Settings/Administrator/Desktop/test.xml'. Line 1,
Position 22

<test><a><b><c></c></a></test>
---------------------^
you can know immediatly that tag b was not closed.

Discussion

  • Karl Waclawek
    Karl Waclawek
    2004-05-02

    Logged In: YES
    user_id=290026

    In principle you are correct, the error messages, and more so,
    the error codes, in Expat are not informative enough. Often
    you just get a syntax error.

    In this case, however, I would say the message is quite clear.

    Nevertheless, the really correct way for an application would
    be to just use the error code and generate a localized and/or
    application specific error message based on this code.

     
  • Karl Waclawek
    Karl Waclawek
    2004-05-02

    Logged In: YES
    user_id=290026

    The attached patch MoreErrors.diff (against current CVS)
    adds a few more error codes in place of the generic
    XML_ERROR_SYNTAX.

    I leave this issue open for review before committing the
    patch. Fred, please have a look as well.

     
  • Karl Waclawek
    Karl Waclawek
    2004-05-02

    • assigned_to: nobody --> kwaclaw
     
  • Karl Waclawek
    Karl Waclawek
    2004-05-02

    Patch to add more error codes

     
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2004-05-18

    Logged In: YES
    user_id=290026

    Committed additional error codes and messages.
    See expat.h rev. 1.69 and xmlparse.c rev. 1.134.

     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=3066

    This is good. I've updated the unit tests to reflect the
    new error codes where applicable.