[jdom-interest] hashCode() and equals()

Elliotte Rusty Harold elharo at metalab.unc.edu
Sat Jun 2 12:50:00 PDT 2001


At 1:01 PM -0500 6/2/01, philip.nelson at omniresources.com wrote:


>>  (Note: I'm not convinced that WSDL is such a system, but I don't want
>>  to make it easy to create one by accident.)
>
>In both WSDL and as Bob pointed out, in XSLT, there are cases where
>comparisons are made where you only know the prefix.

There are simply no such cases in XSLT. Of that I'm 99.9% certain. 
That you think there are indicates to me either that you're 
misunderstanding something or that I'm misunderstanding you. An XSLT 
processor never compares two elements based on their prefixes. It 
always uses the URIs. The XSLT processor always knows what prefix is 
mapped to which URI and what namespace any given element is in. The 
prefix is nothing more than a key into a collection of URIs. If for 
any reason the XSLT processor cannot match the prefix to a URI, then 
the document or stylesheet or both is not namespace well-formed and 
the XML parser should have thrown an error before the document was 
ever passed to the XSLT processor.

>   That doesn't mean that
>the uri doesn't matter and I never said that the spec reads that way.  If
>you need to find the matching definition of an element with
>type="xsd:string", you have to take into consideration the prefix, even if
>all you do is find the matching uri.

No, that's not how schemas work either. A schema does not look for 
the definition of an xsd:string element. It resolves the xsd prefix 
to a URL, say http://www.w3.org/2001/XMLSchema, and it looks for the 
definition of the string type in the http://www.w3.org/2001/XMLSchema 
namespace. The prefix is a lot less important than you seem to think 
it is.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list