cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: What is a Parser?
Date Tue, 28 Jan 2003 08:17:47 GMT
Jeff Turner wrote:
>>Looking in excalibur-xmlutil-20030122.jar, I found this class: 
> I guess you mean o.a.e.xml.sax.SAXParser (to complement
> o.a.e.xml.dom.DOMParser).

Oh yes, but I'm still using excalibur-xmlutil-20030115.jar instead of 
excalibur-xmlutil-20030122.jar. Guess I'd better upgrade.

> (cripes.. I've been happily nulling it in my code.. I'd better go fix:)

I thought it was recommended to always release a component obtained from 
the CM.

> You should get back a JaxpParser instance, which is a Component, so the
> cast is valid.  I'd imagine the compiler doesn't realise this at
> compile-time, and you'd get a ClassCastException if it wasn't a
> Component.

I was under the (probably mistaken) impression that in Java you couldn't 
cast an expression to an unrelated type, but apparently it is legal if 
the type is an interface and not a class. You never stop learning ;-).


Ugo Cei -

To unsubscribe, e-mail:
For additional commands, email:

View raw message