W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

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

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Tue, 15 May 2001 23:18:34 -0600
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08AC5E@thor.aeathtl.com>
To: "'www-dom@w3.org'" <www-dom@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT