ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Namespace informations not preserved for arrays in `toXml` function in `data.xmldata` module #7389

Open SasinduDilshara opened 1 day ago

SasinduDilshara commented 1 day ago

Description

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

type A record {
    @xmldata:Namespace {
        uri: "http://www.example.com",
        prefix: "ex"
    }
    int[] name;
};

public function main() {
    A a = {name: [1, 2, 3]};
    io:println(xmldata:toXml(a)); // Output: <A><name>1</name><name>2</name><name>3</name></A>
}

The output doesn't contains any namespace informtions.

Steps to Reproduce

$Description

Version

2201.10.2

Environment Details (with versions)

No response