You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jeroen van Bemmel (JIRA)" <ax...@ws.apache.org> on 2005/01/10 23:02:12 UTC

[jira] Created: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

AXIS XML interface does not conform to expected DOM behavior
------------------------------------------------------------

         Key: AXIS-1757
         URL: http://issues.apache.org/jira/browse/AXIS-1757
     Project: Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.2    
 Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
    Reporter: Jeroen van Bemmel


The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).

As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.

Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?

JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Jeroen van Bemmel (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=comments#action_58808 ]
     
Jeroen van Bemmel commented on AXIS-1757:
-----------------------------------------

Ashutosh,

It may be that the WSS4J code that makes this call using 'null' is not conforming to DOM3, I am not sure. In any case, wouldn't it be an idea to add

if (ns==null) ns="";

to the code, and keep the rest of the processing as is? People using 'null' should perhaps have used "" instead, since that is probably what they intended, but adding this will forgive them for it

JvB

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=comments#action_58753 ]
     
Davanum Srinivas commented on AXIS-1757:
----------------------------------------

Ashu,

please attach your junit test case as well.

-- dims

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=comments#action_58891 ]
     
Ashutosh Shahi commented on AXIS-1757:
--------------------------------------

Looks reasonable to me. What do others think?? Is it likely to break anything?
If not can we implement this?
Ashutosh

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=comments#action_58898 ]
     
Jongjin Choi commented on AXIS-1757:
------------------------------------

This issue is addressed in 'Backward Compatibility' section of Xerces-J home page and DOM Level 2 errata. (http://www.w3.org/2000/11/DOM-Level-2-errata#core-26).

According to that, I think, it is legal that the user specify null instead of "" as first parameter of getAttributeNS and the result should be same in both case.
 
I think that the patch is reasonable.


> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=history ]

Ashutosh Shahi updated AXIS-1757:
---------------------------------

    Attachment: bug-1757.txt

Attaching a patch for the problem. Passes all-tests.
Ashutosh

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=history ]

Ashutosh Shahi updated AXIS-1757:
---------------------------------

    Attachment: 1757-new.txt

Patch to solve the issue as recommended by Jeroen.
Ashutosh

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: 1757-new.txt, Test1757.java, bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=history ]

Ashutosh Shahi updated AXIS-1757:
---------------------------------

    Attachment: Test1757.java

JUnit Test case for the problem.
Ashutosh

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: 1757-new.txt, Test1757.java, bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=comments#action_58802 ]
     
Ashutosh Shahi commented on AXIS-1757:
--------------------------------------

OK, my patch was considering that if namespaceURI is null, we take it as null; but from what i see in axis code, it is taken as empty string "". So this patch can be considered invalid.
But is this a correct thing to do? Users if not aware, will do a getAttributeNS call using null, as Jeroen did, and will not get the expected output. However if they give "" instead of null output is correct.
Ashutosh


> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>  Attachments: bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=all ]
     
Venkat Reddy resolved AXIS-1757:
--------------------------------

    Resolution: Fixed

Applied the new version of the patch from Ashu.

Thanks
venkat

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>     Assignee: Venkat Reddy
>  Attachments: 1757-new.txt, Test1757.java, bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (AXIS-1757) AXIS XML interface does not conform to expected DOM behavior

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1757?page=all ]

Davanum Srinivas reassigned AXIS-1757:
--------------------------------------

    Assign To: Venkat Reddy

Venkat,

please take care of this.

thanks,
dims

> AXIS XML interface does not conform to expected DOM behavior
> ------------------------------------------------------------
>
>          Key: AXIS-1757
>          URL: http://issues.apache.org/jira/browse/AXIS-1757
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: all platforms (mine is Windows 2000/XP), JDK 1.4.2_06
>     Reporter: Jeroen van Bemmel
>     Assignee: Venkat Reddy
>  Attachments: 1757-new.txt, Test1757.java, bug-1757.txt
>
> The AXIS implementation of some DOM interfaces (in particular: ws-axis/java/src/org/apache/axis/message/MessageElement.java method getAttributeNS) does not behave as expected for DOM. In one case this caused a WSS4J getCanonicalizerMethod() to fail (don't remember the exact signature or file), since it uses 'null' as a first parameter (namespace).
> As can be seen in Xerces-J NamedNodeMapImpl (method protected int findNamePoint(String namespaceURI, String name) ) a first parameter of 'null' should skip a check on namespace, and simply return any node with a matching localname or nodename.
> Since MessageElement implements SOAPElement which extends Element, one would expect the behavior to conform. Or am I missing something here?
> JvB

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira