+1 for Option 3)

On 03.02.21 19:38, Arrigo Marchiori wrote:
Dear List,

bug 128356 [1] is mostly about an XML tag that carries an attribute
_twice_. This is not allowed; the SAX parser raises an exception when
it finds it while loading the file, and the user gets upset because
they cannot open their file any more.

While I am looking for the actual cause of this bug, I think it may be
useful to stop this XML error from happening anywhere. Our API should
complain heavily when requested to do such an illegal action.

I am going to add a ``safety-check'' into the methods of class
SvXMLAttributeList to avoid ``adding'' an attribute that is already in
the list. But what shall these methods do instead, apart from
complaining?

  1- just ignore the request, leaving the current value for the
     attribute;

  2- set the new value, overwriting the current one;

  3- raise an exception because it is just not acceptable.

I personally like option 3-, but someone may have a different opinion?

In addition to this, when finished with the bug, I will try to make
the SAX parser accept these duplicated attributes, and try to carry on
loading the file. This should help our angry users recover their data,
even if some information may be lost.

Please share your opinion.

References:
  1: https://bz.apache.org/ooo/show_bug.cgi?id=128356

Best regards,
--
This is the Way! http://www.apache.org/theapacheway/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to