RE: DOM 3 Core: Overlap with JAXP, Document order of attributes, getChildElementsByTagName, Exceptions

Fred Drake wrote:

> > a particular locale (US English).  It might be something that is 
> > specific to the ECMAScript binding, since it doesn't affect Java
> > implementations.

>   I'm not even sure I understood this concern!  For Python, each
> specific exception code is mapped to specific subclasses of the
> DOMException, and all such exceptions have the appropriate .code
> attribute.

If you are accessing a COM DOM using JScript (and probably true
for other ECMAScript implementations), there is no portable
mechanism for determining the DOMException code for the exception.


try {
   charData.substringData(-5,-5);
}
catch(ex) {
  //
  //   on JScript you can access the HRESULT from a COM implementation
  //     which is an very large negative number with little
  //      or correspondance to the DOMException codes and
  //      a textual description of the error which may
  //      be sensitive to the locale
  var hresult = ex.number;
  var desc = ex.description;

  //
  //    currently if you want to respond to an specific exception
  //       you have to somehow determine from the hresult
  //       and description if it was the exception that you
  //       intended
  var domExceptionCode = 
     someImplementationAndLocaleSpecificRoutine(hresult,desc);

}


I was thinking the implementation specific routine might be
replaced with a standard call back the the DOMImplementation
that could decipher their own error messages.

try {
   charData.substringData(-5,-5);
}
catch(ex) {
  var domExceptionCode = domImpl.getExceptionCode(ex);

}

However, I'm not saying that that is the right solution, however
I do think the problem is legitimate.

Received on Wednesday, 16 May 2001 01:19:37 UTC