Can DOMError::location be null?

Hi,

Can DOMError::location be null?

From my perspective, it makes conceptually sense for a DOMError to not be 
related to a file, a physical location. For example, an error can occur in an 
implementation before handling any file.

From what I can tell, that can be communicated in two ways:

A: The DOMError::location attribute returns null

B: That all of the attributes in the DOMLocator which DOMError::location 
returns are set to null values and -1.

In approach B), the user must check every attribute on the DOMLocator in order 
to determine whether location information is available for the DOMError in 
question. In approach A), it is vastly simpler.

In addition, I question whether the two approaches achieve the same thing. 
From my perspective there's a difference between communicating "No location 
information is available"(DOMError::location is null) and "location 
information was meant to be available, but none of it is."

Also, I fail to see the reason why DOMError::location would have such a 
DOMLocator allocated, except for communicating there is no location info(!).

The reason I ask is that the descriptions for DOMError's attributes ends with 
"returns [...] if any", except for the location attribute. 

Summary: would a DOM implementation be conformant if a DOMError instance had 
its location attribute set to null?


Thanks in advance,

		Frans

Received on Saturday, 21 January 2006 21:40:21 UTC