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 "Ed Slattery (JIRA)" <ji...@apache.org> on 2006/04/20 16:56:05 UTC

[jira] Created: (AXIS2C-133) Wrong namespace attached to attributes

Wrong namespace attached to attributes
--------------------------------------

         Key: AXIS2C-133
         URL: http://issues.apache.org/jira/browse/AXIS2C-133
     Project: Axis2-C
        Type: Bug

  Components: xml/om  
    Versions: 0.90    
 Environment: windows
    Reporter: Ed Slattery
    Priority: Minor


When I serialize an axiom object model, the attributes of the root element which have no namespace associated will pick up the namespace of the previous attribute. The ns value is not cleared after use.
By nulling the ns variable at the end of the loop within routine axis2_om_stax_builder_process_attributes, this problem
gets fixed.  

axis2_status_t
axis2_om_stax_builder_process_attributes (axis2_om_stax_builder_t *om_builder,
                                          axis2_env_t **env,
                                          axis2_om_node_t *element_node)
{
    int i = 0;
     .......
     .....
.
        if(attr_value)
            AXIS2_XML_READER_XML_FREE(builder_impl->parser, env, attr_value);

        ns = NULL;    /* needs to be reset so that attributes with no namespace following those
                                    with a namespace are not attached to the previous namespace  */
    }
    return status;
}



-- 
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] Resolved: (AXIS2C-133) Wrong namespace attached to attributes

Posted by "Nandika Jayawardana (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-133?page=all ]
     
Nandika Jayawardana resolved AXIS2C-133:
----------------------------------------

    Resolution: Fixed

This issue is fixed now, thanks for the fix.

> Wrong namespace attached to attributes
> --------------------------------------
>
>          Key: AXIS2C-133
>          URL: http://issues.apache.org/jira/browse/AXIS2C-133
>      Project: Axis2-C
>         Type: Bug

>   Components: xml/om
>     Versions: 0.90
>  Environment: windows
>     Reporter: Ed Slattery
>     Assignee: Nandika Jayawardana
>     Priority: Minor

>
> When I serialize an axiom object model, the attributes of the root element which have no namespace associated will pick up the namespace of the previous attribute. The ns value is not cleared after use.
> By nulling the ns variable at the end of the loop within routine axis2_om_stax_builder_process_attributes, this problem
> gets fixed.  
> axis2_status_t
> axis2_om_stax_builder_process_attributes (axis2_om_stax_builder_t *om_builder,
>                                           axis2_env_t **env,
>                                           axis2_om_node_t *element_node)
> {
>     int i = 0;
>      .......
>      .....
> .
>         if(attr_value)
>             AXIS2_XML_READER_XML_FREE(builder_impl->parser, env, attr_value);
>         ns = NULL;    /* needs to be reset so that attributes with no namespace following those
>                                     with a namespace are not attached to the previous namespace  */
>     }
>     return status;
> }

-- 
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] Commented: (AXIS2C-133) Wrong namespace attached to attributes

Posted by "Nabeel Yoosuf (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2C-133?page=comments#action_12375386 ] 

Nabeel Yoosuf commented on AXIS2C-133:
--------------------------------------

You are correct. ns picks the previous pointer. we could reset ns to NULL if uri is NULL.

if (uri)
{
...
}
else
{
ns = NULL;
}

> Wrong namespace attached to attributes
> --------------------------------------
>
>          Key: AXIS2C-133
>          URL: http://issues.apache.org/jira/browse/AXIS2C-133
>      Project: Axis2-C
>         Type: Bug

>   Components: xml/om
>     Versions: 0.90
>  Environment: windows
>     Reporter: Ed Slattery
>     Priority: Minor

>
> When I serialize an axiom object model, the attributes of the root element which have no namespace associated will pick up the namespace of the previous attribute. The ns value is not cleared after use.
> By nulling the ns variable at the end of the loop within routine axis2_om_stax_builder_process_attributes, this problem
> gets fixed.  
> axis2_status_t
> axis2_om_stax_builder_process_attributes (axis2_om_stax_builder_t *om_builder,
>                                           axis2_env_t **env,
>                                           axis2_om_node_t *element_node)
> {
>     int i = 0;
>      .......
>      .....
> .
>         if(attr_value)
>             AXIS2_XML_READER_XML_FREE(builder_impl->parser, env, attr_value);
>         ns = NULL;    /* needs to be reset so that attributes with no namespace following those
>                                     with a namespace are not attached to the previous namespace  */
>     }
>     return status;
> }

-- 
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: (AXIS2C-133) Wrong namespace attached to attributes

Posted by "Nandika Jayawardana (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-133?page=all ]

Nandika Jayawardana reassigned AXIS2C-133:
------------------------------------------

    Assign To: Nandika Jayawardana

> Wrong namespace attached to attributes
> --------------------------------------
>
>          Key: AXIS2C-133
>          URL: http://issues.apache.org/jira/browse/AXIS2C-133
>      Project: Axis2-C
>         Type: Bug

>   Components: xml/om
>     Versions: 0.90
>  Environment: windows
>     Reporter: Ed Slattery
>     Assignee: Nandika Jayawardana
>     Priority: Minor

>
> When I serialize an axiom object model, the attributes of the root element which have no namespace associated will pick up the namespace of the previous attribute. The ns value is not cleared after use.
> By nulling the ns variable at the end of the loop within routine axis2_om_stax_builder_process_attributes, this problem
> gets fixed.  
> axis2_status_t
> axis2_om_stax_builder_process_attributes (axis2_om_stax_builder_t *om_builder,
>                                           axis2_env_t **env,
>                                           axis2_om_node_t *element_node)
> {
>     int i = 0;
>      .......
>      .....
> .
>         if(attr_value)
>             AXIS2_XML_READER_XML_FREE(builder_impl->parser, env, attr_value);
>         ns = NULL;    /* needs to be reset so that attributes with no namespace following those
>                                     with a namespace are not attached to the previous namespace  */
>     }
>     return status;
> }

-- 
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