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

[Bug]: XML to Record generation is wrong for sample with multiple namespaces #42556

Open
prakanth97 opened this issue Apr 16, 2024 · 0 comments · May be fixed by #42589
Open

[Bug]: XML to Record generation is wrong for sample with multiple namespaces #42556

prakanth97 opened this issue Apr 16, 2024 · 0 comments · May be fixed by #42589
Assignees
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug

Comments

@prakanth97
Copy link
Contributor

Description

XML source:

<bk:book xmlns:bk="http://example.com/book" xmlns:au="http://example.com/author">
        <bk:id>601970</bk:id>
        <bk:title>string</bk:title>
        <au:title>string</au:title>
        <bk:author>string</bk:author>
        <au:author>string</au:author>
</bk:book>

Generated Record:

@xmldata:Name {value: "book"}
@xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
type Bk_Book record {
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    int id;
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    string[] title;
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    string[] author;
};

But we have to generate below

@xmldata:Name {value: "book"}
@xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
type Bk_Book record {
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    int id;
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    string title;
    @xmldata:Namespace {prefix: "au", uri: "http://example.com/author"}
    @xmldata:Name {value: "title"}
    string title1;
    @xmldata:Namespace {prefix: "bk", uri: "http://example.com/book"}
    string author;
    @xmldata:Name {value: "author"}
    @xmldata:Namespace {prefix: "au", uri: "http://example.com/author"}
    string author1;
};

Steps to Reproduce

No response

Affected Version(s)

2201.9.x

OS, DB, other environment details and versions

No response

Related area

-> Other Area

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the needTriage The issue has to be inspected and labeled manually label Apr 16, 2024
@prakanth97 prakanth97 removed the needTriage The issue has to be inspected and labeled manually label Apr 16, 2024
@MaryamZi MaryamZi added Team/LanguageServer Language Server Implementation related issues. #Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Apr 16, 2024
@mindula mindula linked a pull request Apr 18, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug
Projects
Status: PR Sent
Development

Successfully merging a pull request may close this issue.

4 participants