You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by R....@wcenter.de on 2000/08/24 15:18:40 UTC

versions of org.w3c.dom

----- Forwarded by Ron Piterman/WCENTER on 24.08.00 15:21 -----


Ron Piterman
24.08.00 14:08

 
        To:     cocoon-users@xml.apache.org, xerces-j-dev@xml.apache.org
        cc: 
        Subject:        versions of org.w3c.dom

I noticed the org.w3c.dom classes in xerces are different than the ones I 
downloaded from sun : an example is the Element.getAttributeNS(...) method 
which does not exist in my api.
How come, and where do I get the most up to date api ?
Ron

RE: versions of org.w3c.dom

Posted by Eric Hodges <ha...@swbell.net>.
Hey, it's Arnaud!  I think he's the guy that explained why they didn't just
extend the old interfaces with new ones.

Can you tell me again?  It still seems like the right thing to do.

> -----Original Message-----
> From: Arnaud Le Hors [mailto:lehors@us.ibm.com]
> Sent: Monday, August 28, 2000 6:08 PM
> To: general@xml.apache.org
> Subject: Re: versions of org.w3c.dom
>
>
> I think the right term is "binary compatible". This is, implementations
> compiled against DOM Level 1 run with DOM Level 2. It's however not
> "source compatible". Implementations written for DOM Level 1 will not
> compile with DOM Level 2.
> This is only for _implementations_ though. DOM Level 1 _applications_
> will both compile and run against DOM Level 1 and DOM Level 2 without
> any problem.
> --
> Arnaud  Le Hors - IBM Cupertino, XML Technology Group
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>


Re: versions of org.w3c.dom

Posted by Arnaud Le Hors <le...@us.ibm.com>.
I think the right term is "binary compatible". This is, implementations
compiled against DOM Level 1 run with DOM Level 2. It's however not
"source compatible". Implementations written for DOM Level 1 will not
compile with DOM Level 2.
This is only for _implementations_ though. DOM Level 1 _applications_
will both compile and run against DOM Level 1 and DOM Level 2 without
any problem.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Re: versions of org.w3c.dom

Posted by Eric Hodges <ha...@swbell.net>.
----- Original Message -----
From: "Edwin Goei" <Ed...@eng.sun.com>
To: <ge...@xml.apache.org>
Sent: Friday, August 25, 2000 2:18 PM
Subject: Re: versions of org.w3c.dom


> Eric Hodges wrote:
> >
> > > -----Original Message-----
> > > From: Edwin Goei [mailto:Edwin.Goei@eng.sun.com]
> > > Sent: Thursday, August 24, 2000 2:39 PM
> > > To: general@xml.apache.org
> > > Subject: Re: versions of org.w3c.dom
> > >
> > > DOM is an evolving API that is backward compatible so you should be
able
> > > to use newer DOM interfaces with code that uses older ones.
> >
> > Only it isn't backwards compatible.  They added methods to interfaces
when
> > they did level 2, so code built using the old interfaces won't compile
> > anymore.
>
> How so?  If the (DOM1) app is already compiled, you don't need to
> recompile.  It should work with a DOM1 parser implementation or a DOM2
> parser implementation.  If you want to recompile then if the app is a
> DOM1 app, you should be able to use either a DOM1 or DOM2
> implementation.  However, if your app is a DOM2 app, you must use a DOM2
> impelmentation.
>
> What doesn't work for you?

I should have said code *implementing* the old interfaces won't compile
anymore.  If I have source that implements DOM level 1 interfaces it can't
be built if I have Xerces in the classpath.

Adding methods to a stable interface isn't backwards compatible.  One safe
and simple way to do it is:

interface Document2 extends Document {
    // new and modified methods go here
}

New implementations and clients deal with the new interfaces.  Old
implementations and clients deal with the old interfaces.



Re: versions of org.w3c.dom

Posted by Edwin Goei <Ed...@eng.sun.com>.
Eric Hodges wrote:
> 
> > -----Original Message-----
> > From: Edwin Goei [mailto:Edwin.Goei@eng.sun.com]
> > Sent: Thursday, August 24, 2000 2:39 PM
> > To: general@xml.apache.org
> > Subject: Re: versions of org.w3c.dom
> >
> >
> > R.Piterman@wcenter.de wrote:
> > >
> > > ----- Forwarded by Ron Piterman/WCENTER on 24.08.00 15:21 -----
> > >   Ron Piterman
> > >                           To:        cocoon-users@xml.apache.org,
> > >   24.08.00 14:08  xerces-j-dev@xml.apache.org
> > >                           cc:
> > >                           Subject:        versions of org.w3c.dom
> > >
> > > I noticed the org.w3c.dom classes in xerces are different than the
> > > ones I downloaded from sun : an example is the
> > > Element.getAttributeNS(...) method which does not exist in my api.
> > > How come, and where do I get the most up to date api ?
> > > Ron
> >
> > DOM is an evolving API that is backward compatible so you should be able
> > to use newer DOM interfaces with code that uses older ones.
> 
> Only it isn't backwards compatible.  They added methods to interfaces when
> they did level 2, so code built using the old interfaces won't compile
> anymore.

How so?  If the (DOM1) app is already compiled, you don't need to
recompile.  It should work with a DOM1 parser implementation or a DOM2
parser implementation.  If you want to recompile then if the app is a
DOM1 app, you should be able to use either a DOM1 or DOM2
implementation.  However, if your app is a DOM2 app, you must use a DOM2
impelmentation.

What doesn't work for you?

-Edwin

RE: versions of org.w3c.dom

Posted by Eric Hodges <ha...@swbell.net>.

> -----Original Message-----
> From: Edwin Goei [mailto:Edwin.Goei@eng.sun.com]
> Sent: Thursday, August 24, 2000 2:39 PM
> To: general@xml.apache.org
> Subject: Re: versions of org.w3c.dom
>
>
> R.Piterman@wcenter.de wrote:
> >
> > ----- Forwarded by Ron Piterman/WCENTER on 24.08.00 15:21 -----
> >   Ron Piterman
> >                           To:        cocoon-users@xml.apache.org,
> >   24.08.00 14:08  xerces-j-dev@xml.apache.org
> >                           cc:
> >                           Subject:        versions of org.w3c.dom
> >
> > I noticed the org.w3c.dom classes in xerces are different than the
> > ones I downloaded from sun : an example is the
> > Element.getAttributeNS(...) method which does not exist in my api.
> > How come, and where do I get the most up to date api ?
> > Ron
>
> DOM is an evolving API that is backward compatible so you should be able
> to use newer DOM interfaces with code that uses older ones.

Only it isn't backwards compatible.  They added methods to interfaces when
they did level 2, so code built using the old interfaces won't compile
anymore.

Backwards compatibility would have meant adding interfaces exclusive to
level 2, or adding a whole new package structure.


Re: versions of org.w3c.dom

Posted by Edwin Goei <Ed...@eng.sun.com>.
R.Piterman@wcenter.de wrote:
> 
> ----- Forwarded by Ron Piterman/WCENTER on 24.08.00 15:21 -----
>   Ron Piterman
>                           To:        cocoon-users@xml.apache.org,
>   24.08.00 14:08  xerces-j-dev@xml.apache.org
>                           cc:
>                           Subject:        versions of org.w3c.dom
> 
> I noticed the org.w3c.dom classes in xerces are different than the
> ones I downloaded from sun : an example is the
> Element.getAttributeNS(...) method which does not exist in my api.
> How come, and where do I get the most up to date api ?
> Ron

DOM is an evolving API that is backward compatible so you should be able
to use newer DOM interfaces with code that uses older ones.  Xerces has
the current version of the DOM2 CR classes.  The Sun download is at DOM
level 1.  So putting xerces.jar before any other DOM classes should fix
your problem.

Note: as a side note, when DOM interfaces become a core part of a future
version of the JDK, this will not be possible because it will not be
(generally) possible to override the core classes in the JDK with
classes in the classpath.  This means that newer DOM methods will not be
available until the JDK itself is rev-ed.  That is, unless something
else happens to fix this, of course.

-Edwin