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

Invalid result for toXml function with field namespace annotations #7441

Open
SasinduDilshara opened this issue Dec 4, 2024 · 0 comments · May be fixed by ballerina-platform/module-ballerina-data.xmldata#66
Assignees
Labels

Comments

@SasinduDilshara
Copy link
Contributor

Description

$Subject

Steps to Reproduce

import ballerina/data.xmldata;
import ballerina/io;

type A record {
    @xmldata:Namespace {
        uri: "http://www.example.com/",
        prefix: "ex"
    }
    @xmldata:Name {
        value: "A"
    }
    int a;
};

public function main() {
    A a = {a: 1};
    io:println(xmldata:toXml(a));
}

For the above code it gives <A><ex:a xmlns:ex="http://www.example.com/"><A>1</A></ex:a></A>.

The result should be <A><ex:A xmlns:ex="http://www.example.com/">1</ex:A></A>

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
Labels
Projects
Status: PR Sent
1 participant