cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
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: 
>>org.apache.excalibur.xml.sax.Parser.
> 
> 
> 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

-- 
Ugo Cei - http://www.beblogging.com/blog/


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message