ballerina-platform / ballerina-library

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

Incorrect result when exp type is array in data.xmldata #6898

Open SasinduDilshara opened 1 month ago

SasinduDilshara commented 1 month ago
import ballerina/io;
import ballerina/data.xmldata;

xml x2 = xml `
    <A xmlns:ns1="example1.com" xmlns:ns2="example2.com">
        <ns1:port>1</ns1:port>
        <ns2:port>1</ns2:port>
    </A>
`;

type A record {|
    record{}[] port;
|};

public function main() {
    A|error rec = xmldata:parseAsType(x2);
    io:println(rec);
}

Please consider the above code,

For the Update 10 RTC1 pack, this gives output as {"port":[{"#content":1}]}, But it should be {"port":[{"#content":1}, {"#content":1}]}