You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jason Rizer <ja...@yahoo.com> on 2001/04/05 22:41:40 UTC

Are these two equivalent?

Hello.  I know this is a pretty rudimentary question,
but is there any difference between the following two
sets of code?:

// Sample 1
DocumentImpl doc = new DocumentImpl( );
ElementImpl ele = new ElementImpl(doc, "test");

// Sample 2
Document doc = new DocumentImpl( );
Element ele = doc.createElement("test");

Am I correct to assume that craeteElement( ) returns a
ElementImpl?  The second way is obviously better
because it removes the specific depencey in the code
on org.apache.xerces.dom.  Is there, however, a non
implementation specific way to factory the document? 
I'd like to be able to swap out the xerces parser for
another without changing my code.  Is this possible?
Thanks in advance!

-Jason 

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org