You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Andreas Kasparz <an...@interface-business.de> on 2000/07/31 14:38:24 UTC

Problem building current XERCES / XALAN

During build XERCES, XALAN from the current CVS trees I have found the
fllowing inconsitency (or error?):

In 
    $(XERCES_HOME)/java/src/org/w3c/dom/Node.java
the definition of org.w3c.dom.Node contains the method 
'public boolean hasAttributes();'. This method is not overwritten in 
    $XALAN_HOME)/java/src/org/apache/xalan/xslt/extensions/Nodeset.java
so this results in an error (note that you must not build xalan with
the xerces.jar shipped in the xalan distribution).

BTW - the org.w3c.dom.Node interface doesn't define the 'hsaFeatures' method 
(see: http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/idl/dom.idl)

Best regards,

andy

--
************************************************************************
* Andreas Kasparz - andy@interface-business.de - +49 351 31809 0       *
* Interface-Business GmbH, Tolkewitzer Str. 49, 01277 Dresden, Germany *
************************************************************************

Re: Problem building current XERCES / XALAN

Posted by Andreas Kasparz <an...@interface-business.de>.

Andreas Kasparz wrote:
> 
> 
> An interface **** I S  A  C O N T R A C T **** and I don't have the right
> to 'fix' them.

Sorry all back... DOM2 is a 'Candidate Recommendation' so changig interfaces
is ok...

--
************************************************************************
* Andreas Kasparz - andy@interface-business.de - +49 351 31809 0       *
* Interface-Business GmbH, Tolkewitzer Str. 49, 01277 Dresden, Germany *
************************************************************************

Re: Problem building current XERCES / XALAN

Posted by Andreas Kasparz <an...@interface-business.de>.
Arnaud Le Hors wrote:
> 
> The addition of the hasAttributes() method was decided by the W3C DOM WG
> last week on my request. I implemented it right away and didn't realize

This is a very, very bad solution I think. It would be better to extend
the W3-defined interface by your method and use the customized interface.

> xalan depended on this interface and would break. Sorry about that.

Only Xalan???
Suppose anyone have to develop a system which uses an XML parser and he
develops them based on Xerces. It will be impossible to use any other 
implementation. 

> It is trivial to fix though.

An interface **** I S  A  C O N T R A C T **** and I don't have the right
to 'fix' them.

> Note that the addition of this method was motivated by the fact that in
> some implementations, such as Xerces, smaller memory footprint can be
> achieved if instead of calling directly getAttributes(), you guard it
> with a test of hasAttributes(). The point is that on an element without
> any attributes you'll save the creation of a NamedNodeMap. I therefore
> recommend everybody to update their code along those lines.

Okay, may be this aspect of the interface is badly designed. But it is so.
It should be changed in the next official definition (DOM 2.x or whatever).

> --
> Arnaud  Le Hors - IBM Cupertino, XML Technology Group
> 
> PS: xerces-dev is dead. You should use xerces-j-dev instead.

--
************************************************************************
* Andreas Kasparz - andy@interface-business.de - +49 351 31809 0       *
* Interface-Business GmbH, Tolkewitzer Str. 49, 01277 Dresden, Germany *
************************************************************************

Re: Problem building current XERCES / XALAN

Posted by Arnaud Le Hors <le...@us.ibm.com>.
The addition of the hasAttributes() method was decided by the W3C DOM WG
last week on my request. I implemented it right away and didn't realize
xalan depended on this interface and would break. Sorry about that.
It is trivial to fix though.
Note that the addition of this method was motivated by the fact that in
some implementations, such as Xerces, smaller memory footprint can be
achieved if instead of calling directly getAttributes(), you guard it
with a test of hasAttributes(). The point is that on an element without
any attributes you'll save the creation of a NamedNodeMap. I therefore
recommend everybody to update their code along those lines.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

PS: xerces-dev is dead. You should use xerces-j-dev instead.


Re: Problem building current XERCES / XALAN

Posted by Gary L Peskin <ga...@firstech.com>.
Andy --

If I recall, someone added the hasAttributes() call into Xerces to
comply with an upcoming enhancement to the DOM.  You should be able to
add a similar method to the Nodeset inner class called RootNode.  It can
just look like this:

public boolean hasAttributes() {
  return this.actualFrag.hasAttributes();
}

I'm not sure what the signature for hasAttributes looks like so, if
different from above, make appropriate adjustments.  The Release Notes
do say that Xalan should be build with Xerces 1.1.2 which does _not_
have the hasAttributes() method on Node.

Gary

Andreas Kasparz wrote:
> 
> During build XERCES, XALAN from the current CVS trees I have found the
> fllowing inconsitency (or error?):
> 
> In
>     $(XERCES_HOME)/java/src/org/w3c/dom/Node.java
> the definition of org.w3c.dom.Node contains the method
> 'public boolean hasAttributes();'. This method is not overwritten in
>     $XALAN_HOME)/java/src/org/apache/xalan/xslt/extensions/Nodeset.java
> so this results in an error (note that you must not build xalan with
> the xerces.jar shipped in the xalan distribution).
> 
> BTW - the org.w3c.dom.Node interface doesn't define the 'hsaFeatures' method
> (see: http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/idl/dom.idl)
> 
> Best regards,
> 
> andy

Re: Problem building current XERCES / XALAN

Posted by Arnaud Le Hors <le...@us.ibm.com>.
The addition of the hasAttributes() method was decided by the W3C DOM WG
last week on my request. I implemented it right away and didn't realize
xalan depended on this interface and would break. Sorry about that.
It is trivial to fix though.
Note that the addition of this method was motivated by the fact that in
some implementations, such as Xerces, smaller memory footprint can be
achieved if instead of calling directly getAttributes(), you guard it
with a test of hasAttributes(). The point is that on an element without
any attributes you'll save the creation of a NamedNodeMap. I therefore
recommend everybody to update their code along those lines.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

PS: xerces-dev is dead. You should use xerces-j-dev instead.


Re: Problem building current XERCES / XALAN

Posted by Arnaud Le Hors <le...@us.ibm.com>.
The addition of the hasAttributes() method was decided by the W3C DOM WG
last week on my request. I implemented it right away and didn't realize
xalan depended on this interface and would break. Sorry about that.
It is trivial to fix though.
Note that the addition of this method was motivated by the fact that in
some implementations, such as Xerces, smaller memory footprint can be
achieved if instead of calling directly getAttributes(), you guard it
with a test of hasAttributes(). The point is that on an element without
any attributes you'll save the creation of a NamedNodeMap. I therefore
recommend everybody to update their code along those lines.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

PS: xerces-dev is dead. You should use xerces-j-dev instead.