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

Namespace informations not preserved fornested records in toXml function in data.xmldata module #7390

Open
SasinduDilshara opened this issue Nov 20, 2024 · 0 comments

Comments

@SasinduDilshara
Copy link
Contributor

Description

import ballerina/data.xmldata;
import ballerina/io;
public function main() {
    record {
        record {
            @xmldata:Namespace {
                uri: "http://example3.com/",
                prefix: "c"        
            }
            string c;

            @xmldata:Namespace {
                uri: "http://example1.com/",
                prefix: "a"        
            }
            string a;

            @xmldata:Namespace {
                uri: "http://example3.com/",
                prefix: "b"        
            }
            string b;
        } name;
    } a = {name: {b: "B", a: "A", c: "C"}};
    xml|xmldata:Error xmlResult = xmldata:toXml(a);
    io:println(xmlResult);
}

The above code provides following invalid results

<name><c>C</c><a>A</a><b>B</b></name>

The result doesn't contains any namespace informations

Steps to Reproduce

$Description

Version

2201.10.2

Environment Details (with versions)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Planned for Sprint
Development

No branches or pull requests

1 participant