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

Able to define invalid XMLs with multiple possible root nodes #33501

Closed
madhukaw opened this issue Oct 29, 2021 · 1 comment
Closed

Able to define invalid XMLs with multiple possible root nodes #33501

madhukaw opened this issue Oct 29, 2021 · 1 comment
Labels
Lang/XML XML related issues Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Question

Comments

@madhukaw
Copy link
Contributor

Description:
$Subject

Steps to reproduce:
Run the below sample.

import ballerina/io;

public function main() {
    xml x = xml `<name>Alex</name><age>30</age>`;
    io:println(x);
}

Output:

<name>Alex</name><age>30</age>

However, this is not a valid XML since there can be multiple possible root nodes.

Affected Versions:
SLBeta3

OS, DB, other environment details and versions:
MacOS

@madhukaw madhukaw added Type/Bug Lang/XML XML related issues labels Oct 29, 2021
@anupama-pathirage anupama-pathirage added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Nov 29, 2021
@KavinduZoysa KavinduZoysa added Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Deferred labels Mar 2, 2023
@MaryamZi MaryamZi reopened this Jan 8, 2024
@MaryamZi MaryamZi added Type/Question and removed Type/Bug Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Deferred labels Jan 8, 2024
@MaryamZi
Copy link
Member

MaryamZi commented Jan 8, 2024

The xml type in Ballerina represents all XML values where

An xml value is a sequence representing parsed XML, such as occurs in the content of an XML element.

See https://ballerina.io/spec/lang/master/#XML

An XML value can be a singleton of element, processing instruction, comment, and text or a sequence of multiple items. It is not required to be a valid XML document.

@MaryamZi MaryamZi closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lang/XML XML related issues Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Question
Projects
None yet
Development

No branches or pull requests

4 participants