You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Dumindu Pallewela (JIRA)" <ji...@apache.org> on 2007/01/10 09:56:27 UTC

[jira] Created: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
--------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2C-498
                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
             Project: Axis2-C
          Issue Type: Bug
          Components: xml/om
    Affects Versions: Current (Nightly)
            Reporter: Dumindu Pallewela


When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.

<a xmlns="">
    <b xmlns="urn:def">
        <c xmlns="">
        </c>
    </b>
</a>

I.e., the built OM structure represents the following, which is different to the original XML document:

<a>
    <b xmlns="urn:def">
        <c>
        </c>
    </b>
</a>



However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.

<a>
    <b xmlns="urn:def">
        <c xmlns="">
        </c>
    </b>
</a>


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

        

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


bug in axiom_element_find_namespace?

Posted by Dumindu Pallewela <du...@wso2.com>.
When i call axiom_element_find_namespace with parameters uri="urn:def1" and prefix="" for the following xml, it returns the namespace of element <a>. However since <a>'s namespace is not in effect for the element <c>, since element <b> too has a default namespace defined, I suppose this to be a bug. In any case this is the cause for the jira-498.

<a xmlns="urn:def1">
    <b xmlns="urn:def2">
        <c>
        </c>
    </b>
</a>

Assuming this a bug, what I think should be changed in axiom_element_find_namespace is to, return NULL if the first default namespace found in searching for the given namespace (say N), is not equivalent to N.

A patch is attached herewith. Please review and apply.

Dumindu.


-- patch:

Index: om_element.c
===================================================================
--- om_element.c        (revision 494785)
+++ om_element.c        (working copy)
@@ -271,6 +271,8 @@
                 {
                     return default_ns;
                 }
+                else
+                    return NULL;
             }
             /** prefix is null , so iterate the namespaces hash to find the namespace */
             for (hashindex = axis2_hash_first(om_ele_impl->namespaces, env);





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


[jira] Updated: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Samisa Abeysinghe updated AXIS2C-498:
-------------------------------------

    Fix Version/s: 1.0.0

> Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-498
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: Current (Nightly)
>            Reporter: Dumindu Pallewela
>             Fix For: 1.0.0
>
>         Attachments: patch-498
>
>
> When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
> Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.
> <a xmlns="">
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>
> I.e., the built OM structure represents the following, which is different to the original XML document:
> <a>
>     <b xmlns="urn:def">
>         <c>
>         </c>
>     </b>
> </a>
> However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.
> <a>
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481821 ] 

Samisa Abeysinghe commented on AXIS2C-498:
------------------------------------------

Has someone fixed this for C14N or does it still exist?

Also, if you have test data/source please attach them here.

> Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-498
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: Current (Nightly)
>            Reporter: Dumindu Pallewela
>
> When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
> Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.
> <a xmlns="">
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>
> I.e., the built OM structure represents the following, which is different to the original XML document:
> <a>
>     <b xmlns="urn:def">
>         <c>
>         </c>
>     </b>
> </a>
> However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.
> <a>
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Posted by "Dumindu Pallewela (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dumindu Pallewela updated AXIS2C-498:
-------------------------------------

    Attachment: patch-498

Applied patch fixes this issue. Please review and apply.

In order to test, you can run the test_om program (axiom/test/om/test_om.c) against the xml file provided in the original jira issue.

> Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-498
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: Current (Nightly)
>            Reporter: Dumindu Pallewela
>         Attachments: patch-498
>
>
> When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
> Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.
> <a xmlns="">
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>
> I.e., the built OM structure represents the following, which is different to the original XML document:
> <a>
>     <b xmlns="urn:def">
>         <c>
>         </c>
>     </b>
> </a>
> However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.
> <a>
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Samisa Abeysinghe resolved AXIS2C-498.
--------------------------------------

    Resolution: Fixed

Someone has applied the given patch

> Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-498
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: Current (Nightly)
>            Reporter: Dumindu Pallewela
>             Fix For: 1.0.0
>
>         Attachments: patch-498
>
>
> When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
> Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.
> <a xmlns="">
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>
> I.e., the built OM structure represents the following, which is different to the original XML document:
> <a>
>     <b xmlns="urn:def">
>         <c>
>         </c>
>     </b>
> </a>
> However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.
> <a>
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2C-498) Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace

Posted by "Dumindu Pallewela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463529 ] 

Dumindu Pallewela commented on AXIS2C-498:
------------------------------------------

This behaviour is true not only for empty default namespaces, but also for any other default namespace defined, which is hidden by another default namespace in between.

Eg:

<a xmlns="urn:def1">
    <b xmlns="urn:def2">
        <c xmlns="urn:def1">
        </c>
    </b>
</a>

axiom om structure is equivalent to:

<a xmlns="urn:def1">
    <b xmlns="urn:def2">
        <c>
        </c>
    </b>
</a>


> Axiom OM structure built is inconsistent with the original xml document in certain cases where the default namespace is set to the empty namespace
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-498
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-498
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: Current (Nightly)
>            Reporter: Dumindu Pallewela
>
> When the default namespace is is set to the empty namespace as follows (in element "c") it is ignored while building the OM structure.
> Therefore in the following case the built OM structure says element "c"'s namespace is the same as element "b"'s namespace.
> <a xmlns="">
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>
> I.e., the built OM structure represents the following, which is different to the original XML document:
> <a>
>     <b xmlns="urn:def">
>         <c>
>         </c>
>     </b>
> </a>
> However, it should be noted that in the following case where we do not specifically mention that element "a"'s namespace as the empty namespace; the built OM structure properly represents element "c" as an unqualified element with the empty namespace.
> <a>
>     <b xmlns="urn:def">
>         <c xmlns="">
>         </c>
>     </b>
> </a>

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

        

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