Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Including redundant xmlns field when generating records from an xml value #43721

Open
Nuvindu opened this issue Dec 20, 2024 · 0 comments
Labels
Area/XMLToRecordConverter needTriage The issue has to be inspected and labeled manually Type/Bug

Comments

@Nuvindu
Copy link
Contributor

Nuvindu commented Dec 20, 2024

Description

When generating records from an XML value, a redundant field 'xmlns is added to the record even though it is not necessary. This issue occurs when XML elements include namespace declarations, leading to an additional field being generated for the default namespace attribute. The redundant field causes data mapping issues.

**Input XML: **

<h:TimeStamp xmlns:h="http://htng.org/1.3/Header/" xmlns="http://htng.org/1.3/Header/">2024-07-04T15:37:45.3605563Z</h:TimeStamp>

**Generated record: **

@xmldata:Namespace {prefix: "h", uri: "http://htng.org/1.3/Header/"}
type H_TimeStamp record {
    string \#content;
    @xmldata:Attribute
    string 'xmlns;
};

**Expected record: **

@xmldata:Namespace {prefix: "h", uri: "http://htng.org/1.3/Header/"}
type H_TimeStamp record {
    string \#content;
};

Steps to Reproduce

  1. Provide an XML value with a namespace declaration (e.g., xmlns="http://example.org").

  2. Use the record generation tool to create a record from the XML.

  3. Observe that the generated record includes a redundant xmlns field.

Affected Version(s)

2201.9.3

OS, DB, other environment details and versions

No response

Related area

-> Other Area

Related issue(s) (optional)

https://github.com/wso2-enterprise/internal-support-ballerina/issues/861

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the needTriage The issue has to be inspected and labeled manually label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/XMLToRecordConverter needTriage The issue has to be inspected and labeled manually Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants