ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Bug]: Default namespace is not added to the attributes

Open prakanth97 opened this issue 1 year ago • 1 comments

Description

Source:

<Data xmlns="example.com">
    <A name="John" age="25">1</A>
</Data>

Generated:

type A record {
    int \#content;
    @xmldata:Attribute
    string age;
    @xmldata:Attribute
    string name;
};

@xmldata:Namespace {uri: "example.com"}
type Data record {
    @xmldata:Namespace {uri: "example.com"}
    A A;
};

Correct types:

type A record {
    int \#content;
    @xmldata:Namespace {uri: "example.com"}
    @xmldata:Attribute
    string age;
    @xmldata:Namespace {uri: "example.com"}
    @xmldata:Attribute
    string name;
};

@xmldata:Namespace {uri: "example.com"}
type Data record {
    @xmldata:Namespace {uri: "example.com"}
    A A;
};

Steps to Reproduce

No response

Affected Version(s)

2201.9.1

OS, DB, other environment details and versions

No response

Related area

-> Editor

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

prakanth97 avatar Jul 04 '24 07:07 prakanth97