You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2011/09/05 18:16:10 UTC

[jira] [Created] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Add methods to OMElement that allow calculating the namespace context of an element
-----------------------------------------------------------------------------------

                 Key: AXIOM-388
                 URL: https://issues.apache.org/jira/browse/AXIOM-388
             Project: Axiom
          Issue Type: New Feature
          Components: API
            Reporter: Andreas Veithen


There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.

Examples:

(1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:

http://svn.apache.org/viewvc?view=revision&revision=398161

Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.

(2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:

http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145

To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.

(3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).


To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
* One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
* One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Resolved] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Andreas Veithen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved AXIOM-388.
-----------------------------------

    Resolution: Fixed
    
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135449#comment-13135449 ] 

Hudson commented on AXIOM-388:
------------------------------

Integrated in ws-axiom-trunk #641 (See [https://builds.apache.org/job/ws-axiom-trunk/641/])
    * AXIOM-388: Added an OMElement#getNamespaceContext method.
* Fixed an issue in OMElement#findNamespace related to namespace prefixes that are redeclared.

veithen : 
Files : 
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/namespace/MapBasedNamespaceContext.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/LiveNamespaceContext.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementImplUtil.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestFindNamespaceByNamespaceURIMasked.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetNamespaceContext.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/element/namespacecontext.xml

                
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119027#comment-13119027 ] 

Hudson commented on AXIOM-388:
------------------------------

Integrated in Rampart #584 (See [https://builds.apache.org/job/Rampart/584/])
    RAMPART-324: Added the test case provided by Amila Jayasekara, but implemented a proper fix based on the feature added by AXIOM-388.

veithen : 
Files : 
* /axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml
* /axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
* /axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/rampart/policy/33.xml
* /axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/rampart/services-33.xml
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/EncryptedElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/RequiredElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/SignedElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy12/builders/ContentEncryptedElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy12/builders/EncryptedElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy12/builders/RequiredElementsBuilder.java
* /axis/axis2/java/rampart/trunk/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy12/builders/SignedElementsBuilder.java

                
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Andreas Veithen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIOM-388:
----------------------------------

    Fix Version/s: 1.2.13
         Assignee: Andreas Veithen
    
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136503#comment-13136503 ] 

Hudson commented on AXIOM-388:
------------------------------

Integrated in ws-axiom-trunk #644 (See [https://builds.apache.org/job/ws-axiom-trunk/644/])
    AXIOM-388: Minor Javadoc enhancement.

veithen : 
Files : 
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java

                
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIOM-388) Add methods to OMElement that allow calculating the namespace context of an element

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIOM-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119008#comment-13119008 ] 

Hudson commented on AXIOM-388:
------------------------------

Integrated in ws-axiom-trunk #582 (See [https://builds.apache.org/job/ws-axiom-trunk/582/])
    AXIOM-388: Added a getNamespacesInScope method to OMElement.

veithen : 
Files : 
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/xpath/AXIOMXPath.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/NamespaceIterator.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetNamespacesInScope.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetNamespacesInScopeWithDefaultNamespace.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetNamespacesInScopeWithMaskedDefaultNamespace.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetNamespacesInScopeWithMaskedNamespace.java

                
> Add methods to OMElement that allow calculating the namespace context of an element
> -----------------------------------------------------------------------------------
>
>                 Key: AXIOM-388
>                 URL: https://issues.apache.org/jira/browse/AXIOM-388
>             Project: Axiom
>          Issue Type: New Feature
>          Components: API
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2.13
>
>
> There are a couple of things that the average Java developer is unable to code correctly. One of these things is calculating the namespace context of an element in an XML document.
> Examples:
> (1) The following change in Axis2 attempts to resolve an issue where the databinding fails to resolve a QName value if the prefix is declared on the SOAP envelope:
> http://svn.apache.org/viewvc?view=revision&revision=398161
> Strictly speaking this change is incorrect because it only takes into account namespaces declared on the soap:Envelope, but not on the soap:Body.
> (2) The following change in Synapse adds code to compile an XPath expression retrieved from an XML configuration document:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java?view=diff&r1=1080144&r2=1080145&pathrev=1080145
> To build the namespace context for the XPath expression, the code uses OMElement#getAllDeclaredNamespaces() on the element that has the attribute the XPath expression is extracted from. That is incorrect because namespaces relevant for the interpretation of the XPath expression may also be declared on ancestors of this element.
> (3) RAMPART-40 introduces code that attempts to build a namespace context by scanning the entire document tree for namespace declarations (!).
> To avoid these issues and to make life easier for developers, Axiom should define high level methods that allow to calculate the namespace context of a given element. There should be actually two methods:
> * One that returns an iterator over all namespace declarations in scope. This method could be used e.g. to initialize the namespace context of an XPath expression.
> * One that returns a NamespaceContext object that can be used with other XML APIs that support this interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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